mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-26 03:42:37 +01:00
Core/SAI: Fixed crashes when SAI targets pets that use sai if not tamed
Closes #21870
This commit is contained in:
@@ -70,7 +70,7 @@ bool SmartScript::IsSmart(Creature* c, bool silent)
|
||||
return false;
|
||||
|
||||
bool smart = true;
|
||||
if (c && c->GetAIName() != "SmartAI")
|
||||
if (!dynamic_cast<SmartAI*>(c->AI()))
|
||||
smart = false;
|
||||
|
||||
if (!smart && !silent)
|
||||
@@ -86,7 +86,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)
|
||||
|
||||
Reference in New Issue
Block a user