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:
parent
c92afc57db
commit
b531c1d880
@ -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));
|
||||||
|
@ -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));
|
||||||
|
Loading…
Reference in New Issue
Block a user