diff options
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/CreatureAIImpl.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/game/CreatureAIImpl.h b/src/game/CreatureAIImpl.h index e48ef516b2c..4bb21f1d5ba 100644 --- a/src/game/CreatureAIImpl.h +++ b/src/game/CreatureAIImpl.h @@ -129,6 +129,20 @@ class EventMap : private std::map<uint32, uint32> ScheduleEvent(eventId, time, gcd, phase); } + void RepeatEvent(uint32 time) + { + if(empty()) + return; + uint32 eventId = begin()->second; + erase(begin()); + insert(std::make_pair(time, eventId)); + } + + void PopEvent() + { + erase(begin()); + } + uint32 ExecuteEvent() { while(!empty()) @@ -147,6 +161,23 @@ class EventMap : private std::map<uint32, uint32> return 0; } + uint32 GetEvent() + { + while(!empty()) + { + if(begin()->first > m_time) + return 0; + else if(m_phase && (begin()->second & 0xFF000000) && !(begin()->second & m_phase)) + erase(begin()); + else + { + uint32 eventId = (begin()->second & 0x0000FFFF); + return eventId; + } + } + return 0; + } + void DelayEvents(uint32 time, uint32 gcd) { time += m_time; |
