Scripts/SmartAI: SetData now has an invoker (if the setting is done by something using SmartAI).

Also, some refactors. SMARTAI IS SUCH A FUCKING CLUSTERFUCK I SWEAR.
This commit is contained in:
Treeston
2018-02-15 11:44:37 +01:00
parent b9aec3b4d3
commit cfc77fd843
5 changed files with 53 additions and 24 deletions
+4 -4
View File
@@ -692,9 +692,9 @@ uint32 SmartAI::GetData(uint32 /*id*/) const
return 0;
}
void SmartAI::SetData(uint32 id, uint32 value)
void SmartAI::SetData(uint32 id, uint32 value, Unit* invoker)
{
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, nullptr, id, value);
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, invoker, id, value);
}
void SmartAI::SetGUID(ObjectGuid const& /*guid*/, int32 /*id*/) { }
@@ -1028,9 +1028,9 @@ void SmartGameObjectAI::Destroyed(Player* player, uint32 eventId)
GetScript()->ProcessEventsFor(SMART_EVENT_DEATH, player, eventId, 0, false, nullptr, me);
}
void SmartGameObjectAI::SetData(uint32 id, uint32 value)
void SmartGameObjectAI::SetData(uint32 id, uint32 value, Unit* invoker)
{
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, nullptr, id, value);
GetScript()->ProcessEventsFor(SMART_EVENT_DATA_SET, invoker, id, value);
}
void SmartGameObjectAI::SetTimedActionList(SmartScriptHolder& e, uint32 entry, Unit* invoker)