forked from metin2/server
Fixed quest server timers cancellation
This commit is contained in:
parent
f56d5028da
commit
a04cd735de
@ -1724,14 +1724,20 @@ namespace quest
|
||||
|
||||
void CQuestManager::CancelServerTimers(DWORD arg)
|
||||
{
|
||||
itertype(m_mapServerTimer) it = m_mapServerTimer.begin();
|
||||
for ( ; it != m_mapServerTimer.end(); ++it) {
|
||||
if (it->first.second == arg) {
|
||||
LPEVENT event = it->second;
|
||||
vector<pair<string, DWORD>> timersToDelete;
|
||||
|
||||
// Find server timers that need deleting
|
||||
for (auto& kv: m_mapServerTimer) {
|
||||
if (kv.first.second == arg) {
|
||||
LPEVENT event = kv.second;
|
||||
event_cancel(&event);
|
||||
m_mapServerTimer.erase(it);
|
||||
timersToDelete.push_back(kv.first);
|
||||
}
|
||||
}
|
||||
|
||||
// Delete all the required server timers
|
||||
for (const auto &timer: timersToDelete)
|
||||
m_mapServerTimer.erase(timer);
|
||||
}
|
||||
|
||||
void CQuestManager::SetServerTimerArg(DWORD dwArg)
|
||||
|
Loading…
Reference in New Issue
Block a user