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:
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user