Core/Creature: Fix another pet assert

Fix an assert triggered when dismissing a Warlock pet while it's casting a spell
This commit is contained in:
jackpoz
2019-09-01 19:05:29 +02:00
parent dab66cb8d0
commit 4074cb0f01
2 changed files with 6 additions and 3 deletions

View File

@@ -3158,7 +3158,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;
}
SetGuidValue(UNIT_FIELD_TARGET, _spellFocusInfo.Target);

View File

@@ -255,8 +255,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))
{