From c67a3cd749c90cc36d058bcc3731432d93c2f097 Mon Sep 17 00:00:00 2001 From: Matt Woodrow Date: Fri, 4 Jul 2008 22:54:14 +0000 Subject: [PATCH] Nominations not blocking current map and excluded maps when used from console. Removed error causing debug stuff from mapchooser. --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%402343 --- plugins/mapchooser.sp | 5 ---- plugins/nominations.sp | 54 +++++++++++++++++++----------------------- 2 files changed, 25 insertions(+), 34 deletions(-) diff --git a/plugins/mapchooser.sp b/plugins/mapchooser.sp index bd6b1e98..057638c5 100644 --- a/plugins/mapchooser.sp +++ b/plugins/mapchooser.sp @@ -170,11 +170,6 @@ public bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max) return true; } -public OnMapStart() -{ - Call_Cancel(); -} - public OnConfigsExecuted() { if (ReadMapList(g_MapList, diff --git a/plugins/nominations.sp b/plugins/nominations.sp index f1070d91..dd280e85 100644 --- a/plugins/nominations.sp +++ b/plugins/nominations.sp @@ -184,28 +184,6 @@ public Action:Command_Nominate(client, args) decl String:mapname[64]; GetCmdArg(1, mapname, sizeof(mapname)); - - if (FindStringInArray(g_MapList, mapname) == -1) - { - ReplyToCommand(client, "%t", "Map was not found", mapname); - return Plugin_Handled; - } - - new NominateResult:result = NominateMap(mapname, false, client); - - if (result > Nominate_Replaced) - { - if (result == Nominate_AlreadyInVote) - { - ReplyToCommand(client, "%t", "Map Already In Vote", mapname); - } - else - { - ReplyToCommand(client, "[SM] %t", "Map Already Nominated"); - } - - return Plugin_Handled; - } decl String:item[64]; for (new i = 0; i < GetMenuItemCount(g_MapMenu); i++) @@ -213,17 +191,35 @@ public Action:Command_Nominate(client, args) GetMenuItem(g_MapMenu, i, item, sizeof(item)); if (strcmp(item, mapname) == 0) { + new NominateResult:result = NominateMap(mapname, false, client); + + if (result > Nominate_Replaced) + { + if (result == Nominate_AlreadyInVote) + { + ReplyToCommand(client, "%t", "Map Already In Vote", mapname); + } + else + { + ReplyToCommand(client, "[SM] %t", "Map Already Nominated"); + } + + return Plugin_Handled; + } + RemoveMenuItem(g_MapMenu, i); - break; + + decl String:name[64]; + GetClientName(client, name, sizeof(name)); + + PrintToChatAll("[SM] %t", "Map Nominated", name, mapname); + + return Plugin_Continue; } } - decl String:name[64]; - GetClientName(client, name, sizeof(name)); - - PrintToChatAll("[SM] %t", "Map Nominated", name, mapname); - - return Plugin_Continue; + ReplyToCommand(client, "%t", "Map was not found", mapname); + return Plugin_Handled; } AttemptNominate(client)