diff --git a/bot/scrtimers.cpp b/bot/scrtimers.cpp index 21b6e39..9184627 100644 --- a/bot/scrtimers.cpp +++ b/bot/scrtimers.cpp @@ -78,6 +78,20 @@ DWORD CScriptTimers::New(char* szScriptFunc, int iInterval, BOOL bRepeating, AMX //---------------------------------------------------------------------------------- +void CScriptTimers::Delete(DWORD dwTimerId) +{ + DwordTimerMap::iterator itor; + itor = m_Timers.find(dwTimerId); + if (itor != m_Timers.end()) + { + FreeMem(itor->second); + SAFE_DELETE(itor->second); + m_Timers.erase(itor); + } +} + +//---------------------------------------------------------------------------------- + void CScriptTimers::Kill(DWORD dwTimerId) { DwordTimerMap::iterator itor; diff --git a/bot/scrtimers.h b/bot/scrtimers.h index c1ad00f..efb1565 100644 --- a/bot/scrtimers.h +++ b/bot/scrtimers.h @@ -29,6 +29,7 @@ public: void DeleteForMode(AMX* pEndedAMX); DWORD New(char* szScriptFunc, int iInterval, BOOL bRepeating, AMX* pAMX); + void Delete(DWORD dwTimerId); void Kill(DWORD dwTimerId); void FreeMem(ScriptTimer_s* Timer); };