func (p *Player) OnCreatureDisappear(_creature pul.ICreature, _isLogout bool) { if _creature.GetUID() == p.GetUID() { return } if _isLogout { // Check if creature is in friendlist p.UpdateFriend(_creature.GetName(), false) } p.RemoveVisibleCreature(_creature) }
func (p *Player) OnCreatureAppear(_creature pul.ICreature, _isLogin bool) { if _creature.GetUID() == p.GetUID() { return } if _isLogin { // Check if creature is in friendlist p.UpdateFriend(_creature.GetName(), true) } canSeeCreature := CanSeeCreature(p, _creature) if !canSeeCreature { return } // We're checking inside the AddVisibleCreature method so no need to check here p.AddVisibleCreature(_creature) _creature.AddVisibleCreature(p) }