oops, now it builds (and a bonus refactor that annoyed me)
# Conflicts: # src/server/game/AI/SmartScripts/SmartAI.cpp # src/server/game/AI/SmartScripts/SmartAI.h # src/server/game/AI/SmartScripts/SmartScript.cpp # src/server/game/AI/SmartScripts/SmartScript.h
This commit is contained in:
1 parent
28b33663e7
commit
1f15fe5096
2 files changed
+21
-28
No files matched your search
@@ -1688,12 +1688,12 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (Creature* creature = target->ToCreature())
|
||||
{
|
||||
if (IsSmart(creature))
|
||||
ENSURE_AI(SmartAI, creature->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker());
|
||||
ENSURE_AI(SmartAI, creature->AI())->SetTimedActionList(e, e.action.timedActionList.id, GetLastInvoker());
|
||||
}
|
||||
else if (GameObject* goTarget = target->ToGameObject())
|
||||
{
|
||||
if (IsSmart(goTarget))
|
||||
ENSURE_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, e.action.timedActionList.id, GetLastInvoker());
|
||||
ENSURE_AI(SmartGameObjectAI, goTarget->AI())->SetTimedActionList(e, e.action.timedActionList.id, GetLastInvoker());
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1778,12 +1778,12 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (Creature* creature = target->ToCreature())
|
||||
{
|
||||
if (IsSmart(creature))
|
||||
ENSURE_AI(SmartAI, creature->AI())->SetScript9(e, id, GetLastInvoker());
|
||||
ENSURE_AI(SmartAI, creature->AI())->SetTimedActionList(e, id, GetLastInvoker());
|
||||
}
|
||||
else if (GameObject* goTarget = target->ToGameObject())
|
||||
{
|
||||
if (IsSmart(goTarget))
|
||||
ENSURE_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, id, GetLastInvoker());
|
||||
ENSURE_AI(SmartGameObjectAI, goTarget->AI())->SetTimedActionList(e, id, GetLastInvoker());
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -1802,12 +1802,12 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
|
||||
if (Creature* creature = target->ToCreature())
|
||||
{
|
||||
if (IsSmart(creature))
|
||||
ENSURE_AI(SmartAI, creature->AI())->SetScript9(e, id, GetLastInvoker());
|
||||
ENSURE_AI(SmartAI, creature->AI())->SetTimedActionList(e, id, GetLastInvoker());
|
||||
}
|
||||
else if (GameObject* goTarget = target->ToGameObject())
|
||||
{
|
||||
if (IsSmart(goTarget))
|
||||
ENSURE_AI(SmartGameObjectAI, goTarget->AI())->SetScript9(e, id, GetLastInvoker());
|
||||
ENSURE_AI(SmartGameObjectAI, goTarget->AI())->SetTimedActionList(e, id, GetLastInvoker());
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -3535,10 +3535,10 @@ void SmartScript::UpdateTimer(SmartScriptHolder& e, uint32 const diff)
|
||||
{
|
||||
if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST)
|
||||
{
|
||||
Unit* invoker9 = nullptr;
|
||||
Unit* invoker = nullptr;
|
||||
if (me && mTimedActionListInvoker)
|
||||
invoker9 = ObjectAccessor::GetUnit(*me, mTimedActionListInvoker);
|
||||
ProcessEvent(e, invoker9);
|
||||
invoker = ObjectAccessor::GetUnit(*me, mTimedActionListInvoker);
|
||||
ProcessEvent(e, invoker);
|
||||
e.enableTimed = false;//disable event if it is in an ActionList and was processed once
|
||||
for (SmartAIEventList::iterator i = mTimedActionList.begin(); i != mTimedActionList.end(); ++i)
|
||||
{
|
||||
@@ -3845,7 +3845,7 @@ Unit* SmartScript::DoFindClosestFriendlyInRange(float range, bool playerOnly)
|
||||
return unit;
|
||||
}
|
||||
|
||||
void SmartScript::SetScript9(SmartScriptHolder& e, uint32 entry, Unit* invoker)
|
||||
void SmartScript::SetTimedActionList(SmartScriptHolder& e, uint32 entry, Unit* invoker)
|
||||
{
|
||||
//do NOT clear mTimedActionList if it's being iterated because it will invalidate the iterator and delete
|
||||
// any SmartScriptHolder contained like the "e" parameter passed to this function
|
||||
|
||||
Reference in new issue
Block a user