registerSPForwardByName now automatically unregisters the forward again and returns -1 if the function is not found

This commit is contained in:
Pavol Marko 2004-08-29 16:52:54 +00:00
parent 5a80d24780
commit 54fb9fbfef

View File

@ -300,6 +300,11 @@ int CForwardMngr::registerSPForward(int func, AMX *amx, int numParams, const For
pForward->Set(func, amx, numParams, paramTypes); pForward->Set(func, amx, numParams, paramTypes);
m_SPForwards.push_back(pForward); m_SPForwards.push_back(pForward);
} }
if (pForward->getFuncsNum() == 0)
{
unregisterSPForward(retVal);
return -1;
}
return retVal; return retVal;
} }