plugins/nextmap.sp
changeset 1783 e6e2f440376d
parent 1750 0f73390b01be
child 1793 735f79933e12
     1.1 --- a/plugins/nextmap.sp	Mon Dec 10 12:19:24 2007 +0000
     1.2 +++ b/plugins/nextmap.sp	Mon Dec 10 22:20:53 2007 +0000
     1.3 @@ -96,19 +96,6 @@
     1.4  	// not in mapcyclefile. So we keep it set to the last expected nextmap. - ferret
     1.5  	if (strcmp(lastMap, currentMap) == 0)
     1.6  	{
     1.7 -		if (ReadMapList(g_MapList, 
     1.8 -				g_MapListSerial, 
     1.9 -				"mapcyclefile", 
    1.10 -				MAPLIST_FLAG_CLEARARRAY|MAPLIST_FLAG_NO_DEFAULT)
    1.11 -			== INVALID_HANDLE)
    1.12 -		{
    1.13 -			if (g_MapListSerial == -1)
    1.14 -			{
    1.15 -				LogError("FATAL: Cannot load map cycle. Nextmap not loaded.");
    1.16 -				SetFailState("Mapcycle Not Found");
    1.17 -			}
    1.18 -		}
    1.19 -		
    1.20  		FindAndSetNextMap();
    1.21  	}
    1.22  }
    1.23 @@ -213,6 +200,10 @@
    1.24  		
    1.25  		if (!IsMapValid(map))
    1.26  		{
    1.27 +			if (g_MapPos == -1)
    1.28 +			{
    1.29 +				FindAndSetNextMap();
    1.30 +			}
    1.31  			GetArrayString(g_MapList, g_MapPos, map, sizeof(map));
    1.32  		}
    1.33  		
    1.34 @@ -244,6 +235,19 @@
    1.35   
    1.36  FindAndSetNextMap()
    1.37  {
    1.38 +	if (ReadMapList(g_MapList, 
    1.39 +			g_MapListSerial, 
    1.40 +			"mapcyclefile", 
    1.41 +			MAPLIST_FLAG_CLEARARRAY|MAPLIST_FLAG_NO_DEFAULT)
    1.42 +		== INVALID_HANDLE)
    1.43 +	{
    1.44 +		if (g_MapListSerial == -1)
    1.45 +		{
    1.46 +			LogError("FATAL: Cannot load map cycle. Nextmap not loaded.");
    1.47 +			SetFailState("Mapcycle Not Found");
    1.48 +		}
    1.49 +	}
    1.50 +	
    1.51  	new mapCount = GetArraySize(g_MapList);
    1.52  	decl String:mapName[32];
    1.53