aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDiscover- <amort11@hotmail.com>2013-10-01 10:08:05 +0200
committerDiscover- <amort11@hotmail.com>2013-10-01 10:08:05 +0200
commit11d9a445082daf96b189dec5bfa282bf63a86e63 (patch)
treef2bff1ca68b5c92a7d39dea892c4badc1d9d374f /src
parentc5c3b7ab2ac391a046396be5a14ee09d7c0a874c (diff)
Core/SAI: Properly implement the second parameter of SMART_ACTION_CALL_TIMED_ACTIONLIST to reflect the wiki (which also makes more sense)
Diffstat (limited to 'src')
-rw-r--r--src/server/game/AI/SmartScripts/SmartAI.cpp2
-rw-r--r--src/server/game/AI/SmartScripts/SmartScript.cpp14
2 files changed, 7 insertions, 9 deletions
diff --git a/src/server/game/AI/SmartScripts/SmartAI.cpp b/src/server/game/AI/SmartScripts/SmartAI.cpp
index a56d0f94f2d..57fd7ea2d73 100644
--- a/src/server/game/AI/SmartScripts/SmartAI.cpp
+++ b/src/server/game/AI/SmartScripts/SmartAI.cpp
@@ -206,7 +206,7 @@ void SmartAI::EndPath(bool fail)
mLastWP = NULL;
if (mCanRepeatPath)
- StartPath(mRun, GetScript()->GetPathId(), mCanRepeatPath);
+ StartPath(mRun, GetScript()->GetPathId(), true);
else
GetScript()->SetPathId(0);
diff --git a/src/server/game/AI/SmartScripts/SmartScript.cpp b/src/server/game/AI/SmartScripts/SmartScript.cpp
index c9e1bed6aed..15db816a890 100644
--- a/src/server/game/AI/SmartScripts/SmartScript.cpp
+++ b/src/server/game/AI/SmartScripts/SmartScript.cpp
@@ -1585,8 +1585,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
break;
}
- ObjectList* targets = GetTargets(e, unit);
- if (targets)
+ if (ObjectList* targets = GetTargets(e, unit))
{
for (ObjectList::iterator itr = targets->begin(); itr != targets->end(); ++itr)
{
@@ -3463,16 +3462,15 @@ void SmartScript::SetScript9(SmartScriptHolder& e, uint32 entry)
return;
for (SmartAIEventList::iterator i = mTimedActionList.begin(); i != mTimedActionList.end(); ++i)
{
- if (i == mTimedActionList.begin())
- {
- i->enableTimed = true;//enable processing only for the first action
- }
- else i->enableTimed = false;
+ i->enableTimed = i == mTimedActionList.begin();//enable processing only for the first action
- if (e.action.timedActionList.timerType == 1)
+ if (e.action.timedActionList.timerType == 0)
+ i->event.type = SMART_EVENT_UPDATE_OOC;
+ else if (e.action.timedActionList.timerType == 1)
i->event.type = SMART_EVENT_UPDATE_IC;
else if (e.action.timedActionList.timerType > 1)
i->event.type = SMART_EVENT_UPDATE;
+
InitTimer((*i));
}
}