From 5f25f86b8156383f3b5cd795ed5a0b824bff8b3d Mon Sep 17 00:00:00 2001 From: hondacrx Date: Tue, 4 Jan 2022 19:58:28 -0500 Subject: [PATCH] Core/Creature: Fix another pet assert Port From (https://github.com/TrinityCore/TrinityCore/commit/18d1f0c964a17cc79732eb20958b9c594ebd3628) --- Source/Game/Entities/Creature/Creature.cs | 6 +++++- Source/Game/Handlers/PetHandler.cs | 3 +-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 08ffc8943..642fde2e4 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -3020,7 +3020,11 @@ namespace Game.Entities void ReacquireSpellFocusTarget() { - Cypher.Assert(HasSpellFocus()); + if (!HasSpellFocus()) + { + //Log.outError(LogFilter.Unit, $"Creature::ReacquireSpellFocusTarget() being called with HasSpellFocus() returning false. {GetDebugInfo()}"); + return; + } SetUpdateFieldValue(m_values.ModifyValue(m_unitData).ModifyValue(m_unitData.Target), _spellFocusInfo.Target); diff --git a/Source/Game/Handlers/PetHandler.cs b/Source/Game/Handlers/PetHandler.cs index c905989c6..cba19d17e 100644 --- a/Source/Game/Handlers/PetHandler.cs +++ b/Source/Game/Handlers/PetHandler.cs @@ -241,8 +241,7 @@ namespace Game if (pet.ToPet().GetPetType() == PetType.Hunter) GetPlayer().RemovePet(pet.ToPet(), PetSaveMode.AsDeleted); else - //dismissing a summoned pet is like killing them (this prevents returning a soulshard...) - pet.SetDeathState(DeathState.Corpse); + GetPlayer().RemovePet(pet.ToPet(), PetSaveMode.NotInSlot); } else if (pet.HasUnitTypeMask(UnitTypeMask.Minion)) {