]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Fix the error message that appears when loading an instagib-only map into regular...
authorRudolf Polzer <divVerent@xonotic.org>
Wed, 19 Oct 2016 21:11:10 +0000 (17:11 -0400)
committerRudolf Polzer <divVerent@xonotic.org>
Wed, 19 Oct 2016 21:12:22 +0000 (17:12 -0400)
Replaces:

can't play the selected map in the given game mode (dm). Falling back to
a supported mode (dm)

with:

the selected map lacks features required by current settings; playing
anyway.

Note: such maps aren't selectable/votable anyway, this only applies to the "map" command.

qcsrc/common/mapinfo.qc

index 7120c61eda932fa46b9cc2313dc26c8854549293..2af3d90823e9dcddee7f187889ca50e2da4eddf2 100644 (file)
@@ -1151,12 +1151,14 @@ Gametype MapInfo_CurrentGametype()
        return prev ? prev : MAPINFO_TYPE_DEATHMATCH;
 }
 
-float _MapInfo_CheckMap(string s) // returns 0 if the map can't be played with the current settings, 1 otherwise
+float _MapInfo_CheckMap(string s, bool gametype_only) // returns 0 if the map can't be played with the current settings, 1 otherwise
 {
        if(!MapInfo_Get_ByName(s, 1, NULL))
                return 0;
        if((MapInfo_Map_supportedGametypes & MapInfo_CurrentGametype().m_flags) == 0)
                return 0;
+       if (gametype_only)
+               return 1;
        if((MapInfo_Map_supportedFeatures & MapInfo_CurrentFeatures()) != MapInfo_CurrentFeatures())
                return 0;
        return 1;
@@ -1165,7 +1167,7 @@ float _MapInfo_CheckMap(string s) // returns 0 if the map can't be played with t
 float MapInfo_CheckMap(string s) // returns 0 if the map can't be played with the current settings, 1 otherwise
 {
        float r;
-       r = _MapInfo_CheckMap(s);
+       r = _MapInfo_CheckMap(s, false);
        MapInfo_ClearTemps();
        return r;
 }
@@ -1237,7 +1239,7 @@ void MapInfo_LoadMapSettings(string s) // to be called from worldspawn
        Gametype t = MapInfo_CurrentGametype();
        MapInfo_LoadMapSettings_SaveGameType(t);
 
-       if(!_MapInfo_CheckMap(s)) // with underscore, it keeps temps
+       if(!_MapInfo_CheckMap(s, true)) // with underscore, it keeps temps
        {
                if(cvar("g_mapinfo_allow_unsupported_modes_and_let_stuff_break"))
                {
@@ -1268,6 +1270,9 @@ void MapInfo_LoadMapSettings(string s) // to be called from worldspawn
                LOG_WARNF("can't play the selected map in the given game mode (%s). Falling back to a supported mode (%s).", t_prev.mdl, t.mdl);
                MapInfo_LoadMapSettings_SaveGameType(t);
        }
+       if(!_MapInfo_CheckMap(s, false)) { // with underscore, it keeps temps
+               LOG_WARNF("the selected map lacks features required by current settings; playing anyway.");
+       }
        MapInfo_Get_ByName(s, 1, t);
 }