From b531c1d880678ad20cd46c22076246490d68fee4 Mon Sep 17 00:00:00 2001 From: Richard Helgeby Date: Sun, 14 Feb 2010 16:13:30 +0100 Subject: [PATCH] Imported fix from dev: 607:e4982eeb64d0 - Fixed a bug in client listing menus when selecting a client that left the game caused errors. --- src/zr/zspawn.inc | 9 +++++++++ src/zr/ztele.inc | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/zr/zspawn.inc b/src/zr/zspawn.inc index 05fd24d..c6e9fa0 100644 --- a/src/zr/zspawn.inc +++ b/src/zr/zspawn.inc @@ -285,6 +285,15 @@ public ZSpawnForceHandle(Handle:menu_zspawn_force, MenuAction:action, client, sl // Get the client index of the selected client. 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. decl String:targetname[MAX_NAME_LENGTH]; GetClientName(target, targetname, sizeof(targetname)); diff --git a/src/zr/ztele.inc b/src/zr/ztele.inc index 0cbca67..60ad87f 100644 --- a/src/zr/ztele.inc +++ b/src/zr/ztele.inc @@ -253,6 +253,15 @@ public ZTeleForceHandle(Handle:menu_ztele_force, MenuAction:action, client, slot // Get the client index of the selected client. 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. decl String:targetname[MAX_NAME_LENGTH]; GetClientName(target, targetname, sizeof(targetname));