From b538ed9a2423347f20d74e791a5d8e7f9ee6f398 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 28 Feb 2022 13:10:02 -0500 Subject: [PATCH] Core/Creature: Add null check for charmed creatures Port From (https://github.com/TrinityCore/TrinityCore/commit/ff778a7581b47458d257e867931de0f3b46589e4) --- Source/Game/Entities/Creature/Creature.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/Game/Entities/Creature/Creature.cs b/Source/Game/Entities/Creature/Creature.cs index 9ca2759bd..7ee5a6c53 100644 --- a/Source/Game/Entities/Creature/Creature.cs +++ b/Source/Game/Entities/Creature/Creature.cs @@ -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();