Fix being able to nominate same map multiple times (bug 5109, r=psychonic)

This commit is contained in:
Kyle Sanderson 2014-01-17 23:21:16 -05:00
parent fb734e4124
commit 9fe11f9c36

View File

@ -980,6 +980,12 @@ NominateResult:InternalNominateMap(String:map[], bool:force, owner)
return Nominate_InvalidMap; return Nominate_InvalidMap;
} }
/* Map already in the vote */
if (FindStringInArray(g_NominateList, map) != -1)
{
return Nominate_AlreadyInVote;
}
new index; new index;
/* Look to replace an existing nomination by this client - Nominations made with owner = 0 aren't replaced */ /* 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; return Nominate_VoteFull;
} }
/* Map already in the vote */
if (FindStringInArray(g_NominateList, map) != -1)
{
return Nominate_AlreadyInVote;
}
PushArrayString(g_NominateList, map); PushArrayString(g_NominateList, map);
PushArrayCell(g_NominateOwners, owner); PushArrayCell(g_NominateOwners, owner);
g_NominateCount++; g_NominateCount++;