Skip to content

Commit ab9c33c

Browse files
committed
Refactor timed event processing
1 parent b8247b2 commit ab9c33c

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

ElunaEventMgr.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,14 @@ EventMgr::~EventMgr()
125125
globalProcessor->RemoveEvents_internal();
126126
}
127127

128+
void EventMgr::UpdateProcessors(uint32 diff)
129+
{
130+
if (!processors.empty())
131+
for (ProcessorSet::const_iterator it = processors.begin(); it != processors.end(); ++it) // loop processors
132+
(*it)->Update(diff);
133+
globalProcessor->Update(diff);
134+
}
135+
128136
void EventMgr::SetStates(LuaEventState state)
129137
{
130138
if (!processors.empty())

ElunaEventMgr.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ class EventMgr
109109
// Sets the eventId's state in all processors
110110
// Execute only in safe env
111111
void SetState(int eventId, LuaEventState state);
112+
113+
void UpdateProcessors(uint32 diff);
112114
};
113115

114116
#endif

LuaEngine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ void Eluna::UpdateEluna(uint32 diff)
876876
#endif
877877
_ReloadEluna();
878878

879-
eventMgr->globalProcessor->Update(diff);
879+
eventMgr->UpdateProcessors(diff);
880880
#if defined ELUNA_TRINITY
881881
GetQueryProcessor().ProcessReadyCallbacks();
882882
#endif

0 commit comments

Comments
 (0)