Revert "Core/SAI: Fixed crashes when SAI targets pets that use sai if not tamed"

This reverts commit 9fd67b7044.
It's crashing core, it very likely needs to import more commits from 3.3.5a before this can be re-added
This commit is contained in:
Aokromes
2018-05-12 13:17:14 +02:00
parent 76261ca5a7
commit ae1abb63be

View File

@@ -65,7 +65,7 @@ SmartScript::~SmartScript()
bool SmartScript::IsSmart(Creature* c /*= nullptr*/)
{
bool smart = true;
if (!dynamic_cast<SmartAI*>(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<SmartGameObjectAI*>(g->AI()))
if (g && g->GetAIName() != "SmartGameObjectAI")
smart = false;
if (!go || go->GetAIName() != "SmartGameObjectAI")