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

Port From (https://github.com/TrinityCore/TrinityCore/commit/334b02e1daeac7be31ed3ce855a5ff221add80aa)
This commit is contained in:
hondacrx
2021-09-26 13:14:14 -04:00
parent 569e20ebc1
commit 365da29692
+2 -2
View File
@@ -4112,7 +4112,7 @@ namespace Game.AI
return false;
bool smart = true;
if (creature != null && creature.GetAIName() != "SmartAI")
if (creature.GetAI<SmartAI>() == 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<SmartAI>() == null)
smart = false;
if (!smart && !silent)