diff options
author | Subv2112 <s.v.h21@hotmail.com> | 2012-01-22 10:42:13 -0500 |
---|---|---|
committer | Subv2112 <s.v.h21@hotmail.com> | 2012-01-22 10:42:13 -0500 |
commit | 8e8be7e358e4d41932abce81fc8474dfde2afbc3 (patch) | |
tree | f1f674a61086c55f6449616777fc52b5f1e2c00b /src | |
parent | f4778a6b72d64de0820fb6b576760147ea5a820f (diff) |
Core/SAI: CAST_AI will return NULL if the cast was not successful, no need to check for AIName, thanks Shauren
Diffstat (limited to 'src')
-rw-r--r-- | src/server/game/AI/SmartScripts/SmartScript.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp index 1224be0e1ae..5a235e1e1e4 100644 --- a/src/server/game/AI/SmartScripts/SmartScript.cpp +++ b/src/server/game/AI/SmartScripts/SmartScript.cpp @@ -1803,22 +1803,17 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr) { - bool smart = false; SmartAI* ai = NULL; if (IsGameObject(*itr)) - { - smart = IsSmartGO((*itr)->ToGameObject()); ai = CAST_AI(SmartAI, (*itr)->ToGameObject()->AI()); - } if (IsCreature(*itr)) - { - smart = IsSmart((*itr)->ToCreature()); ai = CAST_AI(SmartAI, (*itr)->ToCreature()->AI()); - } - if (smart && ai) + if (ai) ai->GetScript()->StoreTargetList(GetTargetList(e.action.sendTargetToTarget.id), e.action.sendTargetToTarget.id); + else + sLog->outErrorDb("SmartScript: Action target for SMART_ACTION_SEND_TARGET_TO_TARGET is not using SmartAI, skipping"); break; } |