Fixed another serious bug where deleting menus and not returning PLUGIN_HANDLED would cause the iterator to fail and crash

This commit is contained in:
David Anderson
2006-11-21 23:59:21 +00:00
parent c15a23a2a7
commit db7dc509e0
6 changed files with 35 additions and 11 deletions

View File

@ -901,6 +901,7 @@ void C_ClientCommand(edict_t *pEntity)
pPlayer->menu = 0;
MenuMngr::iterator a = g_menucmds.begin();
MenuMngr::iterator old = g_menucmds.SetWatchIter(a);
while (a)
{
@ -940,8 +941,15 @@ void C_ClientCommand(edict_t *pEntity)
if (ret & 1) RETURN_META(MRES_SUPERCEDE);
}
}
++a;
if (g_menucmds.GetWatchIter() != a)
{
a = g_menucmds.GetWatchIter();
} else {
++a;
}
}
g_menucmds.SetWatchIter(old);
}
}