mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user