From 5849a0d2e248627710d77ae5aa6ba81fabafcd51 Mon Sep 17 00:00:00 2001 From: Michael McKoy Date: Sat, 24 Nov 2007 03:28:33 +0000 Subject: [PATCH] The current map played shouldn't appear in MapChooser votes or RTV votes now. It can still be nominated in RTV though. --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%401725 --- plugins/mapchooser.sp | 21 +++++++++------------ plugins/rockthevote.sp | 9 ++++++++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/plugins/mapchooser.sp b/plugins/mapchooser.sp index 2daed5f2..55cea42c 100644 --- a/plugins/mapchooser.sp +++ b/plugins/mapchooser.sp @@ -521,30 +521,27 @@ CreateNextVote() } decl String:map[32]; - new Handle:tempMaps = CloneArray(g_MapList); + new index, Handle:tempMaps = CloneArray(g_MapList); + + GetCurrentMap(map, sizeof(map)); + index = FindStringInArray(tempMaps, map); + if (index != -1) + { + RemoveFromArray(tempMaps, index); + } if (GetConVarInt(g_Cvar_ExcludeMaps) && GetArraySize(tempMaps) > GetConVarInt(g_Cvar_ExcludeMaps)) { for (new i = 0; i < GetArraySize(g_OldMapList); i++) { GetArrayString(g_OldMapList, i, map, sizeof(map)); - new index = FindStringInArray(tempMaps, map); + index = FindStringInArray(tempMaps, map); if (index != -1) { RemoveFromArray(tempMaps, index); } } } - else - { - // If we didn't check against ExcludeMaps, we have to remove the current map. - GetCurrentMap(map, sizeof(map)); - new index = FindStringInArray(tempMaps, map); - if (index != -1) - { - RemoveFromArray(tempMaps, index); - } - } new limit = (GetConVarInt(g_Cvar_IncludeMaps) < GetArraySize(tempMaps) ? GetConVarInt(g_Cvar_IncludeMaps) : GetArraySize(tempMaps)); for (new i = 0; i < limit; i++) diff --git a/plugins/rockthevote.sp b/plugins/rockthevote.sp index cc4b5b50..a57f038a 100644 --- a/plugins/rockthevote.sp +++ b/plugins/rockthevote.sp @@ -344,6 +344,13 @@ public Action:Timer_StartRTV(Handle:timer) new Handle:tempMaps = CloneArray(g_MapList); decl String:map[32]; + + GetCurrentMap(map, sizeof(map)); + new index = FindStringInArray(tempMaps, map); + if (index != -1) + { + RemoveFromArray(tempMaps, index); + } // We assume that g_RTVMapList is within the correct limits, based on the logic for nominations for (new i = 0; i < GetArraySize(g_RTVMapList); i++) @@ -351,7 +358,7 @@ public Action:Timer_StartRTV(Handle:timer) GetArrayString(g_RTVMapList, i, map, sizeof(map)); AddMenuItem(MapVoteMenu, map, map); - new index = FindStringInArray(tempMaps, map); + index = FindStringInArray(tempMaps, map); if (index != -1) { RemoveFromArray(tempMaps, index);