mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Spells: Possible crash fix
Get Unit target with the proper method instead of retrieving Object target and then casting it to Unit, possible dereferencing NULL. Updates #11560
This commit is contained in:
@@ -3020,7 +3020,7 @@ void Spell::cast(bool skipCheck)
|
||||
if (this->GetSpellInfo()->DmgClass != SPELL_DAMAGE_CLASS_NONE)
|
||||
if (Pet* playerPet = playerCaster->GetPet())
|
||||
if (playerPet->IsAlive() && playerPet->isControlled() && (m_targets.GetTargetMask() & TARGET_FLAG_UNIT))
|
||||
playerPet->AI()->OwnerAttacked(m_targets.GetObjectTarget()->ToUnit());
|
||||
playerPet->AI()->OwnerAttacked(m_targets.GetUnitTarget());
|
||||
}
|
||||
|
||||
SetExecutedCurrently(true);
|
||||
|
||||
Reference in New Issue
Block a user