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)
|
void CQuestManager::CancelServerTimers(DWORD arg)
|
||||||
{
|
{
|
||||||
itertype(m_mapServerTimer) it = m_mapServerTimer.begin();
|
vector<pair<string, DWORD>> timersToDelete;
|
||||||
for ( ; it != m_mapServerTimer.end(); ++it) {
|
|
||||||
if (it->first.second == arg) {
|
// Find server timers that need deleting
|
||||||
LPEVENT event = it->second;
|
for (auto& kv: m_mapServerTimer) {
|
||||||
event_cancel(&event);
|
if (kv.first.second == arg) {
|
||||||
m_mapServerTimer.erase(it);
|
LPEVENT event = kv.second;
|
||||||
}
|
event_cancel(&event);
|
||||||
}
|
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)
|
void CQuestManager::SetServerTimerArg(DWORD dwArg)
|
||||||
|
|
Loading…
Reference in New Issue