]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
mapinfo cleanups
authorRudolf Polzer <divverent@alientrap.org>
Sat, 6 Nov 2010 16:03:59 +0000 (17:03 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Sat, 6 Nov 2010 16:03:59 +0000 (17:03 +0100)
qcsrc/common/mapinfo.qc
qcsrc/common/mapinfo.qh

index 33889827e36deebad5975fc15b7cc171b79ff708..5192b75ac24ea37fd4a67cc72bc885b80dd3ea60 100644 (file)
@@ -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
                {
index 4e6ac985517df071103f4ea3e70c0d1d53c2229d..1fcc0dc662783ebd056281a5732a9d75ca98a31f 100644 (file)
@@ -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