mapchoose_extended: properly fix 40f3680e08

This commit is contained in:
BotoX 2016-08-23 13:26:09 +02:00
parent 3fb959dffc
commit 072ce9f815

View File

@ -483,7 +483,6 @@ public void OnConfigsExecuted()
if(g_Cvar_VoteNextLevel != INVALID_HANDLE)
SetConVarBool(g_Cvar_VoteNextLevel, false);
CreateNextVote();
SetupTimeleftTimer();
g_TotalRounds = 0;
@ -992,6 +991,7 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
return;
CheckMapPlayerRestriction();
CreateNextVote();
g_ChangeTime = when;
@ -1141,10 +1141,6 @@ void InitiateVote(MapChange when, Handle inputlist=INVALID_HANDLE)
GetArrayString(g_NextMapList, count, map, PLATFORM_MAX_PATH);
count++;
// Honor map restriction.
if(InternalGetMapPlayerRestriction(map) != 0)
continue;
if(randomizeList == INVALID_HANDLE)
{
/* Insert the map and increment our count */
@ -1320,7 +1316,6 @@ public void Handler_VoteFinishedGeneric(Handle menu,
// We extended, so we'll have to vote again.
g_RunoffCount = 0;
g_HasVoteStarted = false;
CreateNextVote();
SetupTimeleftTimer();
}
@ -1334,7 +1329,6 @@ public void Handler_VoteFinishedGeneric(Handle menu,
g_RunoffCount = 0;
g_HasVoteStarted = false;
CreateNextVote();
SetupTimeleftTimer();
}
else
@ -1637,7 +1631,7 @@ void CreateNextVote()
ClearArray(g_NextMapList);
static char map[PLATFORM_MAX_PATH];
Handle tempMaps = CloneArray(g_MapList);
Handle tempMaps = CloneArray(g_MapList);
GetCurrentMap(map, PLATFORM_MAX_PATH);
RemoveStringFromArray(tempMaps, map);
@ -1658,8 +1652,14 @@ void CreateNextVote()
for(int i = 0; i < limit; i++)
{
int b = GetRandomInt(0, GetArraySize(tempMaps) - 1);
GetArrayString(tempMaps, b, map, PLATFORM_MAX_PATH);
int b;
for(int j = 0; j < 10; j++)
{
b = GetRandomInt(0, GetArraySize(tempMaps) - 1);
GetArrayString(tempMaps, b, map, PLATFORM_MAX_PATH);
if(InternalGetMapPlayerRestriction(map) == 0)
break;
}
PushArrayString(g_NextMapList, map);
RemoveFromArray(tempMaps, b);
}