]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add an option to prevent Deathmatch maps showing up in Duel (off by default since...
authorMario <mario@smbclan.net>
Wed, 4 Sep 2019 15:20:03 +0000 (01:20 +1000)
committerMario <mario@smbclan.net>
Wed, 4 Sep 2019 15:20:03 +0000 (01:20 +1000)
gamemodes-server.cfg
qcsrc/common/mapinfo.qh

index d38cee893adbe0931b23bc73aa063440fb5655c8..c6e1e30a3adc3b2f2508f1aceae349185d460288 100644 (file)
@@ -545,3 +545,4 @@ set g_invasion_type 0 "type of invasion mode - 0: round-based, 1: hunting, 2: co
 set g_duel 0 "Duel: frag the opponent more in a one versus one arena battle"
 //set g_duel_warmup 180 "Have a short warmup period before beginning the actual duel"
 set g_duel_with_powerups 0 "Enable powerups to spawn in the duel gamemode"
+set g_duel_not_dm_maps 0 "when this is set, DM maps will NOT be listed in duel"
index 6fbb7ce896235d53fe240be81fd83ea0aea25002..60db1608a31b8eb9c0b728ca65d33ac6cd340831 100644 (file)
@@ -594,10 +594,13 @@ CLASS(Duel, Gametype)
     }
     METHOD(Duel, m_isForcedSupported, bool(Gametype this))
     {
-        // force all DM maps to work in duel?!
-        // TODO: we should really check the size of maps, some DM maps do not work for duel!
-        if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags))
-            return true;
+        if(!cvar("g_duel_not_dm_maps"))
+        {
+            // if this is set, all DM maps support duel too
+            // TODO: we should really check the size of maps, some DM maps do not work for duel!
+            if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags))
+                return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported)
+        }
         return false;
     }
 ENDCLASS(Duel)