private void HandleEffectSummonVanityPet(UnitEntity target, SpellTargetInfo.SpellTargetEffectInfo info) { if (!(target is Player player)) { return; } // enqueue removal of existing vanity pet if summoned if (player.VanityPetGuid != null) { VanityPet oldVanityPet = player.GetVisible <VanityPet>(player.VanityPetGuid.Value); oldVanityPet?.RemoveFromMap(); player.VanityPetGuid = 0u; } var vanityPet = new VanityPet(player, info.Entry.DataBits00); var position = new MapPosition { Position = player.Position }; if (player.Map.CanEnter(vanityPet, position)) { player.Map.EnqueueAdd(vanityPet, position); } }
private void HandleEffectSummonVanityPet(UnitEntity target, SpellTargetInfo.SpellTargetEffectInfo info) { if (!(target is Player player)) { return; } var vanityPet = new VanityPet(player, info.Entry.DataBits00); player.Map.EnqueueAdd(vanityPet, player.Position); }