mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-24 19:06:49 +01:00
Core/Creature: ported assert crashfix that fixes a focus related crash that was happening when dismissing a warlock pet while it was casting a spell
This commit is contained in:
@@ -3080,7 +3080,11 @@ void Creature::ReleaseSpellFocus(Spell const* focusSpell, bool withDelay)
|
||||
|
||||
void Creature::ReacquireSpellFocusTarget()
|
||||
{
|
||||
ASSERT(HasSpellFocus());
|
||||
if (!HasSpellFocus())
|
||||
{
|
||||
TC_LOG_ERROR("entities.unit", "Creature::ReacquireSpellFocusTarget() being alled with HasSpellFocus() return false.");
|
||||
return;
|
||||
}
|
||||
|
||||
SetGuidValue(UNIT_FIELD_TARGET, _spellFocusInfo.target);
|
||||
|
||||
|
||||
@@ -261,17 +261,12 @@ void WorldSession::HandlePetActionHelper(Unit* pet, ObjectGuid guid1, uint32 spe
|
||||
if (pet->IsPet())
|
||||
{
|
||||
if (((Pet*)pet)->IsHunterPet())
|
||||
{
|
||||
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_DISMISS);
|
||||
}
|
||||
else if (pet->HasUnitTypeMask(UNIT_MASK_MINION))
|
||||
{
|
||||
((Minion*)pet)->UnSummon();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case COMMAND_MOVE_TO:
|
||||
|
||||
Reference in New Issue
Block a user