Core/Creature: Add null check for charmed creatures
Port From (https://github.com/TrinityCore/TrinityCore/commit/ff778a7581b47458d257e867931de0f3b46589e4)
This commit is contained in:
@@ -2789,7 +2789,7 @@ namespace Game.Entities
|
||||
public virtual byte GetPetAutoSpellSize() { return 4; }
|
||||
public virtual uint GetPetAutoSpellOnPos(byte pos)
|
||||
{
|
||||
if (pos >= SharedConst.MaxSpellCharm || GetCharmInfo().GetCharmSpell(pos).GetActiveState() != ActiveStates.Enabled)
|
||||
if (pos >= SharedConst.MaxSpellCharm || GetCharmInfo() == null || GetCharmInfo().GetCharmSpell(pos).GetActiveState() != ActiveStates.Enabled)
|
||||
return 0;
|
||||
else
|
||||
return GetCharmInfo().GetCharmSpell(pos).GetAction();
|
||||
|
||||
Reference in New Issue
Block a user