Core/SAI: Properly implement the second parameter of SMART_ACTION_CALL_TIMED_ACTIONLIST to reflect the wiki (which also makes more sense)

This commit is contained in:
Discover-
2013-10-01 10:08:05 +02:00
parent c5c3b7ab2a
commit 11d9a44508
2 changed files with 7 additions and 9 deletions

View File

@@ -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);

View File

@@ -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));
}
}