From 54fb9fbfefe66992f0017735a0ce6c31a44128f9 Mon Sep 17 00:00:00 2001 From: Pavol Marko Date: Sun, 29 Aug 2004 16:52:54 +0000 Subject: [PATCH] registerSPForwardByName now automatically unregisters the forward again and returns -1 if the function is not found --- amxmodx/CForward.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/amxmodx/CForward.cpp b/amxmodx/CForward.cpp index 356387e9..9420bb6e 100755 --- a/amxmodx/CForward.cpp +++ b/amxmodx/CForward.cpp @@ -300,6 +300,11 @@ int CForwardMngr::registerSPForward(int func, AMX *amx, int numParams, const For pForward->Set(func, amx, numParams, paramTypes); m_SPForwards.push_back(pForward); } + if (pForward->getFuncsNum() == 0) + { + unregisterSPForward(retVal); + return -1; + } return retVal; }