From 30f306782764ba966f1c8e3ac994de17c96192df Mon Sep 17 00:00:00 2001 From: David Anderson Date: Wed, 31 Oct 2007 05:26:08 +0000 Subject: [PATCH] - fixed bug where the menu map parser truncated lines and thus gave IsMapValid() weird results - fixed a bug where kicking yourself could throw an RTE --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401664 --- plugins/basecommands/kick.sp | 5 ++++- plugins/basecommands/map.sp | 16 +++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/basecommands/kick.sp b/plugins/basecommands/kick.sp index ca1cd084..935100a2 100644 --- a/plugins/basecommands/kick.sp +++ b/plugins/basecommands/kick.sp @@ -141,7 +141,10 @@ public Action:Command_Kick(client, args) { kick_self = client; } - PerformKick(client, target_list[i], Arguments[len]); + else + { + PerformKick(client, target_list[i], Arguments[len]); + } } if (kick_self) diff --git a/plugins/basecommands/map.sp b/plugins/basecommands/map.sp index 79456582..45b00ad9 100644 --- a/plugins/basecommands/map.sp +++ b/plugins/basecommands/map.sp @@ -120,22 +120,28 @@ LoadMapList(Handle:menu) return LoadMapFolder(menu); } - decl String:buffer[64], len; + decl String:buffer[256], len; while (!IsEndOfFile(file) && ReadFileLine(file, buffer, sizeof(buffer))) { TrimString(buffer); - + if ((len = StrContains(buffer, ".bsp", false)) != -1) { buffer[len] = '\0'; } - if (buffer[0] == '\0' || !IsValidConVarChar(buffer[0]) || !IsMapValid(buffer)) + if (buffer[0] == '\0' + || buffer[0] == ';' + || buffer[0] == '/' + || !IsValidConVarChar(buffer[0])) { continue; } - - AddMenuItem(menu, buffer, buffer); + + if (IsMapValid(buffer)) + { + AddMenuItem(menu, buffer, buffer); + } } CloseHandle(file);