From e378c45be7f050e82430f681ab47ca3b2c60dc15 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Thu, 9 Sep 2004 20:32:34 +0000 Subject: [PATCH] Fixed bug where the first registered forward would be automatically unregistered on unregisterForward too --- amxmodx/CForward.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/amxmodx/CForward.cpp b/amxmodx/CForward.cpp index 9996256b..8ec84936 100755 --- a/amxmodx/CForward.cpp +++ b/amxmodx/CForward.cpp @@ -197,7 +197,7 @@ cell CSPForward::execute(cell *params, ForwardPreparedArray *preparedArrays) if (!m_HasFunc) return 0; - + CPluginMngr::CPlugin *pPlugin = g_plugins.findPluginFast(m_Amx); if (!pPlugin->isExecutable(m_Func)) return 0; @@ -397,13 +397,11 @@ bool CForwardMngr::isSPForward(int id) const void CForwardMngr::unregisterSPForward(int id) { - unsigned int i = 0; - //make sure the id is valid - if ( !isIdValid(id) || m_SPForwards.at(i >> 1)->isFree ) + if ( !isIdValid(id) || m_SPForwards.at(id >> 1)->isFree ) return; - m_SPForwards.at(i >> 1)->isFree = true; + m_SPForwards.at(id >> 1)->isFree = true; m_FreeSPForwards.push(id); }