Core/Creature: Fix another pet assert

Fix an assert triggered when dismissing a Warlock pet while it's casting a spell

(cherry picked from commit 4074cb0f01)
This commit is contained in:
jackpoz
2019-09-01 19:05:29 +02:00
committed by Shauren
parent 13dfa97d71
commit 18d1f0c964
2 changed files with 6 additions and 3 deletions

View File

@@ -3300,7 +3300,11 @@ void Creature::ReleaseSpellFocus(Spell const* focusSpell, bool withDelay)
void Creature::ReacquireSpellFocusTarget()
{
ASSERT(HasSpellFocus());
if (!HasSpellFocus())
{
TC_LOG_ERROR("entities.unit", "Creature::ReacquireSpellFocusTarget() being called with HasSpellFocus() returning false. %s", GetDebugInfo().c_str());
return;
}
SetUpdateFieldValue(m_values.ModifyValue(&Unit::m_unitData).ModifyValue(&UF::UnitData::Target), _spellFocusInfo.Target);

View File

@@ -253,8 +253,7 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
if (((Pet*)pet)->getPetType() == HUNTER_PET)
GetPlayer()->RemovePet((Pet*)pet, PET_SAVE_AS_DELETED);
else
// dismissing a summoned pet is like killing them (this prevents returning a soulshard...)
pet->setDeathState(CORPSE);
GetPlayer()->RemovePet((Pet*)pet, PET_SAVE_NOT_IN_SLOT);
}
else if (pet->HasUnitTypeMask(UNIT_MASK_MINION))
{