Core/Creature: Add null check for charmed creatures

Port From (https://github.com/TrinityCore/TrinityCore/commit/ff778a7581b47458d257e867931de0f3b46589e4)
This commit is contained in:
hondacrx
2022-02-28 13:10:02 -05:00
parent cfc5b510ce
commit b538ed9a24
+1 -1
View File
@@ -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();