From 365da29692dfdc2ab5ff0fd3b15490046aae4ee6 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Sun, 26 Sep 2021 13:14:14 -0400 Subject: [PATCH] Core/SAI: Fixed crashes when SAI targets pets that use sai if not tamed Port From (https://github.com/TrinityCore/TrinityCore/commit/334b02e1daeac7be31ed3ce855a5ff221add80aa) --- Source/Game/AI/SmartScripts/SmartScript.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/Game/AI/SmartScripts/SmartScript.cs b/Source/Game/AI/SmartScripts/SmartScript.cs index 9aa71bcbd..bfc4a6632 100644 --- a/Source/Game/AI/SmartScripts/SmartScript.cs +++ b/Source/Game/AI/SmartScripts/SmartScript.cs @@ -4112,7 +4112,7 @@ namespace Game.AI return false; bool smart = true; - if (creature != null && creature.GetAIName() != "SmartAI") + if (creature.GetAI() == null) smart = false; if (!smart && !silent) @@ -4127,7 +4127,7 @@ namespace Game.AI return false; bool smart = true; - if (gameObject != null && gameObject.GetAIName() != "SmartGameObjectAI") + if (gameObject.GetAI() == null) smart = false; if (!smart && !silent)