mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-15 23:20:36 +01:00
Core/EventProcessor: std::chrono-ify the remaining public API
(cherry picked from commit 1d8782e356)
This commit is contained in:
@@ -110,24 +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, Milliseconds 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_execTime = e_time.count();
|
||||
m_events.insert(std::pair<uint64, BasicEvent*>(e_time.count(), event));
|
||||
}
|
||||
|
||||
void EventProcessor::ModifyEventTime(BasicEvent* event, uint64 newTime)
|
||||
void EventProcessor::ModifyEventTime(BasicEvent* event, Milliseconds newTime)
|
||||
{
|
||||
for (auto itr = m_events.begin(); itr != m_events.end(); ++itr)
|
||||
{
|
||||
if (itr->second != event)
|
||||
continue;
|
||||
|
||||
event->m_execTime = newTime;
|
||||
event->m_execTime = newTime.count();
|
||||
m_events.erase(itr);
|
||||
m_events.insert(std::pair<uint64, BasicEvent*>(newTime, event));
|
||||
m_events.insert(std::pair<uint64, BasicEvent*>(newTime.count(), event));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user