[bot] Implement/match CScriptTimers::Delete(...)

This commit is contained in:
RD42 2024-08-29 23:24:28 +08:00
parent c1d02b9ab0
commit 4c3bfe503f
2 changed files with 15 additions and 0 deletions

View File

@ -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) void CScriptTimers::Kill(DWORD dwTimerId)
{ {
DwordTimerMap::iterator itor; DwordTimerMap::iterator itor;

View File

@ -29,6 +29,7 @@ public:
void DeleteForMode(AMX* pEndedAMX); void DeleteForMode(AMX* pEndedAMX);
DWORD New(char* szScriptFunc, int iInterval, BOOL bRepeating, AMX* pAMX); DWORD New(char* szScriptFunc, int iInterval, BOOL bRepeating, AMX* pAMX);
void Delete(DWORD dwTimerId);
void Kill(DWORD dwTimerId); void Kill(DWORD dwTimerId);
void FreeMem(ScriptTimer_s* Timer); void FreeMem(ScriptTimer_s* Timer);
}; };