works with post now

This commit is contained in:
David Anderson 2006-02-03 03:28:43 +00:00
parent 2ad9a320de
commit 07affb56f2

View File

@ -503,14 +503,20 @@ static cell AMX_NATIVE_CALL unregister_forward(AMX *amx, cell *params)
return 0;
}
CVector<int>::iterator begin, end=Engine[func].end();
CVector<int> *peng = NULL;
if (post)
peng = &(Engine[func]);
else
peng = &(EnginePost[func]);
for (begin=Engine[func].begin(); begin!=end; begin++)
CVector<int>::iterator begin, end=peng->end();
for (begin=peng->begin(); begin!=end; begin++)
{
if ((*begin) == func_id)
{
Engine[func].erase(begin);
if (!Engine[func].size())
peng->erase(begin);
if (!peng->size())
{
//:TODO: we should probably clear this here!
//but, we have no reverse lookup possible.
@ -522,7 +528,6 @@ static cell AMX_NATIVE_CALL unregister_forward(AMX *amx, cell *params)
return 0;
}
static cell AMX_NATIVE_CALL register_forward(AMX *amx, cell *params)
{
int func = params[1];