[nexuiz-commits] r8317 - trunk/data/qcsrc/common

DONOTREPLY at icculus.org DONOTREPLY at icculus.org
Mon Nov 23 02:01:10 EST 2009


Author: div0
Date: 2009-11-23 02:01:10 -0500 (Mon, 23 Nov 2009)
New Revision: 8317

Modified:
   trunk/data/qcsrc/common/mapinfo.qc
Log:
mapinfo: don't refuse unsupported game types if they at least require no special entities


Modified: trunk/data/qcsrc/common/mapinfo.qc
===================================================================
--- trunk/data/qcsrc/common/mapinfo.qc	2009-11-22 21:16:41 UTC (rev 8316)
+++ trunk/data/qcsrc/common/mapinfo.qc	2009-11-23 07:01:10 UTC (rev 8317)
@@ -1074,7 +1074,7 @@
 
 void MapInfo_LoadMapSettings(string s) // to be called from worldspawn
 {
-	float t;
+	float t, t0;
 	if(!_MapInfo_CheckMap(s)) // with underscore, it keeps temps
 	{
 		if(MapInfo_Map_supportedGametypes <= 0)
@@ -1087,8 +1087,26 @@
 			MapInfo_Map_supportedGametypes = floor(MapInfo_Map_supportedGametypes / 2);
 		}
 		// t is now a supported mode!
-		print("EMERGENCY: can't play the selected map in the given game mode. Falling back to a supported mode.\n");
-		MapInfo_SwitchGameType(t);
+		t0 = MapInfo_CurrentGametype();
+		switch(t0)
+		{
+			case MAPINFO_TYPE_RUNEMATCH:
+			case MAPINFO_TYPE_TEAM_DEATHMATCH:
+			case MAPINFO_TYPE_LMS:
+			case MAPINFO_TYPE_ARENA:
+			case MAPINFO_TYPE_CA:
+			case MAPINFO_TYPE_KEYHUNT:
+			case MAPINFO_TYPE_DEATHMATCH:
+				print("EMERGENCY: can't play the selected map in the given game mode. Working with only the override settings.\n");
+				cvar_set("timelimit", "0");
+				cvar_set("fraglimit", "0");
+				cvar_set("g_keyhunt_teams", "3");
+				break;
+			default:
+				print("EMERGENCY: can't play the selected map in the given game mode. Falling back to a supported mode.\n");
+				MapInfo_SwitchGameType(t);
+				break;
+		}
 	}
 	cvar_settemp_restore();
 	MapInfo_Get_ByName(s, 1, MapInfo_CurrentGametype());



More information about the nexuiz-commits mailing list