From ae1abb63be02ff8283ea6d3abb2303b833014f28 Mon Sep 17 00:00:00 2001 From: Aokromes Date: Sat, 12 May 2018 13:17:14 +0200 Subject: [PATCH] Revert "Core/SAI: Fixed crashes when SAI targets pets that use sai if not tamed" This reverts commit 9fd67b7044793c95c68a595c12a529e02409d19b. It's crashing core, it very likely needs to import more commits from 3.3.5a before this can be re-added --- src/server/game/AI/SmartScripts/SmartScript.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 26ec90fdd60..5853c8914ee 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -65,7 +65,7 @@ SmartScript::~SmartScript() bool SmartScript::IsSmart(Creature* c /*= nullptr*/) { bool smart = true; - if (!dynamic_cast(c->AI())) + if (c && c->GetAIName() != "SmartAI") smart = false; if (!me || me->GetAIName() != "SmartAI") @@ -80,7 +80,7 @@ bool SmartScript::IsSmart(Creature* c /*= nullptr*/) bool SmartScript::IsSmartGO(GameObject* g /*= nullptr*/) { bool smart = true; - if (!dynamic_cast(g->AI())) + if (g && g->GetAIName() != "SmartGameObjectAI") smart = false; if (!go || go->GetAIName() != "SmartGameObjectAI")