From c8db3432782ed5b1354232f5ee06e56e5f8fa0cb Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 31 Jan 2021 01:15:46 -0500 Subject: [PATCH] Core/Spells: Fix crash when using spells with mindcontrol. --- Source/Game/Handlers/PetHandler.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Game/Handlers/PetHandler.cs b/Source/Game/Handlers/PetHandler.cs index dde6fbf78..64f7faba1 100644 --- a/Source/Game/Handlers/PetHandler.cs +++ b/Source/Game/Handlers/PetHandler.cs @@ -201,9 +201,8 @@ namespace Game charmInfo.SetIsReturning(false); CreatureAI AI = pet.ToCreature().GetAI(); - PetAI petAI = (PetAI)AI; - if (petAI != null) - petAI._AttackStart(TargetUnit); // force target switch + if (AI is PetAI) + ((PetAI)AI)._AttackStart(TargetUnit); // force target switch else AI.AttackStart(TargetUnit);