From: Mario Date: Wed, 4 Sep 2019 15:20:03 +0000 (+1000) Subject: Add an option to prevent Deathmatch maps showing up in Duel (off by default since... X-Git-Tag: xonotic-v0.8.5~1318 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=08c646dfd3e22a4ed003fb286cbe092f161f66c4;p=xonotic%2Fxonotic-data.pk3dir.git Add an option to prevent Deathmatch maps showing up in Duel (off by default since no maps list support for Duel) --- diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index d38cee893..c6e1e30a3 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -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" diff --git a/qcsrc/common/mapinfo.qh b/qcsrc/common/mapinfo.qh index 6fbb7ce89..60db1608a 100644 --- a/qcsrc/common/mapinfo.qh +++ b/qcsrc/common/mapinfo.qh @@ -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)