Core/SAI: merged a smartAI crash fix

This commit is contained in:
Ovahlord committed 2018-09-23 23:53:57 +02:00
1 parent a7c11d723e
commit 4f6263e6f3
1 file changed
+2 -2
@@ -71,7 +71,7 @@ bool SmartScript::IsSmart(Creature* c, bool silent)
return false;
bool smart = true;
if (!me || me->GetAIName() != "SmartAI")
if (!dynamic_cast<SmartAI*>(c->AI()))
smart = false;
if (!smart && !silent)
@@ -87,7 +87,7 @@ bool SmartScript::IsSmart(GameObject* g, bool silent)
return false;
bool smart = true;
if (g && g->GetAIName() != "SmartGameObjectAI")
if (!dynamic_cast<SmartGameObjectAI*>(g->AI()))
smart = false;
if (!smart && !silent)