diff options
author | Treeston <treeston.mmoc@gmail.com> | 2017-11-30 20:45:44 +0100 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2021-02-25 18:50:55 +0100 |
commit | 2c0b94a000332492fbe7b1dff80dca0e54713cf3 (patch) | |
tree | bfc1151eccfc6f277db79a311fa6877b52a38bb4 /src/common/Utilities/EventProcessor.cpp | |
parent | f1388f37b6151252aae7431921564cf2458226a4 (diff) |
Some misc streamlining/cleanup:
- std::chrono overloads for SummonCreature
- Removed misleading const qualifier from SummonCreature (it wasn't being honored)
- Rename parameters of SummonCreature to follow convention
- EventProcessor has a new method (AddEventAtOffset) that adds an event...at an offset. Genius.
PS: Hi there Keader.
(cherry picked from commit 76a4c7d9748fdbfa925e81a3257acdee53d4f86e)
Diffstat (limited to 'src/common/Utilities/EventProcessor.cpp')
-rw-r--r-- | src/common/Utilities/EventProcessor.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/src/common/Utilities/EventProcessor.cpp b/src/common/Utilities/EventProcessor.cpp index 2cba5476c7d..3895b767aec 100644 --- a/src/common/Utilities/EventProcessor.cpp +++ b/src/common/Utilities/EventProcessor.cpp @@ -110,29 +110,24 @@ void EventProcessor::KillAllEvents(bool force) m_events.clear(); } -void EventProcessor::AddEvent(BasicEvent* Event, uint64 e_time, bool set_addtime) +void EventProcessor::AddEvent(BasicEvent* event, uint64 e_time, bool set_addtime) { if (set_addtime) - Event->m_addTime = m_time; - Event->m_execTime = e_time; - m_events.insert(std::pair<uint64, BasicEvent*>(e_time, Event)); + event->m_addTime = m_time; + event->m_execTime = e_time; + m_events.insert(std::pair<uint64, BasicEvent*>(e_time, event)); } -void EventProcessor::ModifyEventTime(BasicEvent* Event, uint64 newTime) +void EventProcessor::ModifyEventTime(BasicEvent* event, uint64 newTime) { for (auto itr = m_events.begin(); itr != m_events.end(); ++itr) { - if (itr->second != Event) + if (itr->second != event) continue; - Event->m_execTime = newTime; + event->m_execTime = newTime; m_events.erase(itr); - m_events.insert(std::pair<uint64, BasicEvent*>(newTime, Event)); + m_events.insert(std::pair<uint64, BasicEvent*>(newTime, event)); break; } } - -uint64 EventProcessor::CalculateTime(uint64 t_offset) const -{ - return(m_time + t_offset); -} |