From fdbee670c56b188d7a7d7877f1c26675e89d253f Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Mon, 25 Jul 2005 21:02:26 +0000 Subject: [PATCH] Uh, forgot... --- amxmodx/CTask.cpp | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/amxmodx/CTask.cpp b/amxmodx/CTask.cpp index eadb78d6..e2aa04e1 100755 --- a/amxmodx/CTask.cpp +++ b/amxmodx/CTask.cpp @@ -74,17 +74,30 @@ void CTaskMngr::CTask::set(CPluginMngr::CPlugin *pPlugin, int iFunc, int iFlags, void CTaskMngr::CTask::clear() { + m_bFree = true; + if (m_iFunc >= 0) { unregisterSPForward(m_iFunc); m_iFunc = -1; } - m_bFree = true; + if (m_pParams) { delete [] m_pParams; m_pParams = NULL; } + + m_pPlugin = NULL; + m_iId = 0; + m_fBase = 0.0f; + + m_iRepeat = 0; + m_bLoop = false; + m_bAfterStart = false; + m_bBeforeEnd = false; + + m_fNextExecTime = 0.0f; } bool CTaskMngr::CTask::isFree() const @@ -146,6 +159,21 @@ void CTaskMngr::CTask::executeIfRequired(float fCurrentTime, float fTimeLimit, f CTaskMngr::CTask::CTask() { m_bFree = true; + + m_pPlugin = NULL; + m_iFunc = -1; + m_iId = 0; + m_fBase = 0.0f; + + m_iRepeat = 0; + m_bLoop = false; + m_bAfterStart = false; + m_bBeforeEnd = false; + + m_fNextExecTime = 0.0f; + + m_iParamLen = 0; + m_pParams = NULL; } CTaskMngr::CTask::~CTask()