Updated randomcycle to use the Nextmap API
authorMatt Woodrow <pred@alliedmods.net>
Sun Sep 21 14:20:01 2008 +1200 (2008-09-21)
changeset 23155ce2188ebe36
parent 2314 96b2aa64513e
child 2316 b43df30e5578
child 2323 efa6bfdd7571
Updated randomcycle to use the Nextmap API
plugins/randomcycle.sp
     1.1 --- a/plugins/randomcycle.sp	Thu Sep 18 18:42:13 2008 +1200
     1.2 +++ b/plugins/randomcycle.sp	Sun Sep 21 14:20:01 2008 +1200
     1.3 @@ -43,7 +43,6 @@
     1.4  	url = "http://www.sourcemod.net/"
     1.5  };
     1.6  
     1.7 -new Handle:g_Cvar_Nextmap = INVALID_HANDLE;
     1.8  new Handle:g_Cvar_ExcludeMaps = INVALID_HANDLE;
     1.9  
    1.10  new Handle:g_MapList = INVALID_HANDLE;
    1.11 @@ -63,14 +62,6 @@
    1.12  
    1.13  public OnConfigsExecuted()
    1.14  {
    1.15 -	g_Cvar_Nextmap = FindConVar("sm_nextmap");
    1.16 -
    1.17 -	if (g_Cvar_Nextmap == INVALID_HANDLE)
    1.18 -	{
    1.19 -		LogError("FATAL: Cannot find sm_nextmap cvar. RandomCycle not loaded.");
    1.20 -		SetFailState("sm_nextmap not found");
    1.21 -	}
    1.22 -	
    1.23  	if (ReadMapList(g_MapList, 
    1.24  					g_mapListSerial, 
    1.25  					"randomcycle", 
    1.26 @@ -105,8 +96,8 @@
    1.27  		GetArrayString(g_MapList, b, map, sizeof(map));
    1.28  	}
    1.29  	
    1.30 -	SetConVarString(g_Cvar_Nextmap, map);
    1.31  	PushArrayString(g_OldMapList, map);
    1.32 +	SetNextMap(map);
    1.33  
    1.34  	if (GetArraySize(g_OldMapList) > GetConVarInt(g_Cvar_ExcludeMaps))
    1.35  	{