From 9fe11f9c3638962befcc2cbfaadc91f2ca2c7920 Mon Sep 17 00:00:00 2001 From: Kyle Sanderson Date: Fri, 17 Jan 2014 23:21:16 -0500 Subject: [PATCH] Fix being able to nominate same map multiple times (bug 5109, r=psychonic) --- plugins/mapchooser.sp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/mapchooser.sp b/plugins/mapchooser.sp index 8de4460f..c32ee887 100644 --- a/plugins/mapchooser.sp +++ b/plugins/mapchooser.sp @@ -980,6 +980,12 @@ NominateResult:InternalNominateMap(String:map[], bool:force, owner) return Nominate_InvalidMap; } + /* Map already in the vote */ + if (FindStringInArray(g_NominateList, map) != -1) + { + return Nominate_AlreadyInVote; + } + new index; /* Look to replace an existing nomination by this client - Nominations made with owner = 0 aren't replaced */ @@ -1002,13 +1008,6 @@ NominateResult:InternalNominateMap(String:map[], bool:force, owner) return Nominate_VoteFull; } - /* Map already in the vote */ - if (FindStringInArray(g_NominateList, map) != -1) - { - return Nominate_AlreadyInVote; - } - - PushArrayString(g_NominateList, map); PushArrayCell(g_NominateOwners, owner); g_NominateCount++;