From: Rudolf Polzer Date: Sat, 6 Nov 2010 16:03:59 +0000 (+0100) Subject: mapinfo cleanups X-Git-Tag: xonotic-v0.1.0preview~190 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fxonotic-data.pk3dir.git;a=commitdiff_plain;h=8d9014cc511146a286b5d4486c0cb3fc011e106e mapinfo cleanups --- diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index 33889827e..5192b75ac 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -907,6 +907,7 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype { t = car(s); s = cdr(s); if (t == "weapons") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_WEAPONS; + else if(t == "new_toys") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_WEAPONS; else dprint("Map ", pFilename, " supports unknown feature ", t, ", ignored\n"); } @@ -1029,8 +1030,9 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype { if(!(MapInfo_Map_supportedGametypes & pGametypeToSet)) { - print("Can't select the requested game type. Trying anyway with stupid settings.\n"); - _MapInfo_Map_ApplyGametypeEx("", pGametypeToSet, MAPINFO_TYPE_DEATHMATCH); + error("Can't select the requested game type. This should never happen as the caller should prevent it!\n"); + //_MapInfo_Map_ApplyGametypeEx("", pGametypeToSet, MAPINFO_TYPE_DEATHMATCH); + //return; } } @@ -1232,6 +1234,8 @@ void MapInfo_LoadMapSettings(string s) // to be called from worldspawn { print("Mapinfo system is not functional at all. Assuming deathmatch.\n"); MapInfo_Map_supportedGametypes = MAPINFO_TYPE_DEATHMATCH; + _MapInfo_Map_ApplyGametypeEx("", t0, t0); + return; // do not call Get_ByName! } t = 1; @@ -1245,12 +1249,9 @@ void MapInfo_LoadMapSettings(string s) // to be called from worldspawn if(cvar("g_mapinfo_allow_unsupported_modes_and_let_stuff_break")) { 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_tdm_teams", "2"); - cvar_set("g_keyhunt_teams", "3"); - cvar_set("g_race_qualifying_timelimit", "0"); - cvar_set("leadlimit", "0"); + cvar_settemp_restore(); + _MapInfo_Map_ApplyGametypeEx("", t0, t0); + return; // do not call Get_ByName! } else { diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index 4e6ac9855..1fcc0dc66 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -1,18 +1,18 @@ -float MAPINFO_TYPE_CTF = 1; -float MAPINFO_TYPE_ASSAULT = 2; -float MAPINFO_TYPE_ONSLAUGHT = 4; -float MAPINFO_TYPE_RACE = 8; -float MAPINFO_TYPE_DEATHMATCH = 16; -float MAPINFO_TYPE_TEAM_DEATHMATCH = 32; -float MAPINFO_TYPE_DOMINATION = 64; -float MAPINFO_TYPE_RUNEMATCH = 128; -float MAPINFO_TYPE_LMS = 256; -float MAPINFO_TYPE_ARENA = 512; -float MAPINFO_TYPE_KEYHUNT = 1024; -float MAPINFO_TYPE_NEXBALL = 2048; -float MAPINFO_TYPE_CTS = 4096; -float MAPINFO_TYPE_CA = 8192; -float MAPINFO_TYPE_ALL = 16383; // this has to include all above bits +float MAPINFO_TYPE_DEATHMATCH = 1; +float MAPINFO_TYPE_LMS = 2; +float MAPINFO_TYPE_ARENA = 4; +float MAPINFO_TYPE_RUNEMATCH = 8; +float MAPINFO_TYPE_RACE = 16; +float MAPINFO_TYPE_CTS = 32; +float MAPINFO_TYPE_TEAM_DEATHMATCH = 64; +float MAPINFO_TYPE_CTF = 128; +float MAPINFO_TYPE_CA = 256; +float MAPINFO_TYPE_DOMINATION = 512; +float MAPINFO_TYPE_KEYHUNT = 1024; +float MAPINFO_TYPE_ASSAULT = 2048; +float MAPINFO_TYPE_ONSLAUGHT = 4096; +float MAPINFO_TYPE_NEXBALL = 8192; +float MAPINFO_TYPE_ALL = 16383; // this has to include all above bits float MAPINFO_FEATURE_WEAPONS = 1; // not defined for minstagib-only maps