Imported fix from dev: 607:e4982eeb64d0 - Fixed a bug in client listing menus when selecting a client that left the game caused errors.

This commit is contained in:
Richard Helgeby 2010-02-14 16:13:30 +01:00
parent c92afc57db
commit b531c1d880
2 changed files with 18 additions and 0 deletions

View File

@ -285,6 +285,15 @@ public ZSpawnForceHandle(Handle:menu_zspawn_force, MenuAction:action, client, sl
// Get the client index of the selected client. // Get the client index of the selected client.
new target = MenuGetClientIndex(menu_zspawn_force, slot); new target = MenuGetClientIndex(menu_zspawn_force, slot);
// If the target is 0, then the client left before being selected from the menu.
if (target == 0)
{
// Re-send the menu.
MenuClientList(client, ZSpawnForceHandle, true, true, false, "ZSpawn clients title");
return;
}
// Get the target's name for future use. // Get the target's name for future use.
decl String:targetname[MAX_NAME_LENGTH]; decl String:targetname[MAX_NAME_LENGTH];
GetClientName(target, targetname, sizeof(targetname)); GetClientName(target, targetname, sizeof(targetname));

View File

@ -253,6 +253,15 @@ public ZTeleForceHandle(Handle:menu_ztele_force, MenuAction:action, client, slot
// Get the client index of the selected client. // Get the client index of the selected client.
new target = MenuGetClientIndex(menu_ztele_force, slot); new target = MenuGetClientIndex(menu_ztele_force, slot);
// If the target is 0, then the client left before being selected from the menu.
if (target == 0)
{
// Re-send the menu.
MenuClientList(client, ZTeleForceHandle, true, true, false, "ZTele clients title");
return;
}
// Get the target's name for future use. // Get the target's name for future use.
decl String:targetname[MAX_NAME_LENGTH]; decl String:targetname[MAX_NAME_LENGTH];
GetClientName(target, targetname, sizeof(targetname)); GetClientName(target, targetname, sizeof(targetname));