From: Mario Date: Thu, 30 Jun 2022 13:37:03 +0000 (+1000) Subject: Change map support cvar to allow Keepaway maps to be played in Team Keepaway rather... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=42f43955f47454d05939981b48af99dad979235a;p=xonotic%2Fxonotic-data.pk3dir.git Change map support cvar to allow Keepaway maps to be played in Team Keepaway rather than Deathmatch maps, enable by default Add a separate cvar to allow Team Deathmatch maps to be played in Team Keepaway, disabled by default --- diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index 56cb88a748..548ca34788 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -574,7 +574,8 @@ set g_duel_not_dm_maps 0 "when this is set, DM maps will NOT be listed in duel" // team keepaway // =============== set g_tka 0 "another game mode which focuses around a ball" -set g_tka_on_dm_maps 0 "when this is set, all DM and KA maps automatically support TKA" +set g_tka_on_ka_maps 1 "when this is set, all KA maps automatically support TKA" +set g_tka_on_tdm_maps 0 "when this is set, all TDM maps automatically support TKA" set g_tka_teams 2 "how many teams are in team keepaway (set by mapinfo)" set g_tka_team_spawns 0 "when 1, players spawn from the team spawnpoints of the map, if any" set g_tka_teams_override 0 "how many teams are in team keepaway" diff --git a/qcsrc/common/gamemodes/gamemode/tka/tka.qh b/qcsrc/common/gamemodes/gamemode/tka/tka.qh index 33b17ed72f..8a07f5f657 100644 --- a/qcsrc/common/gamemodes/gamemode/tka/tka.qh +++ b/qcsrc/common/gamemodes/gamemode/tka/tka.qh @@ -33,10 +33,16 @@ CLASS(TeamKeepaway, Gametype) } METHOD(TeamKeepaway, m_isForcedSupported, bool(Gametype this)) { - if(cvar("g_tka_on_dm_maps")) + if(cvar("g_tka_on_ka_maps")) { - // if this is set, all DM and KA maps support TKA too - if(!(MapInfo_Map_supportedGametypes & this.m_flags) && ((MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH.m_flags) || (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEEPAWAY.m_flags))) + // if this is set, all KA maps support TKA too + if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_KEEPAWAY.m_flags)) + return true; // TODO: references another gametype (alternatively, we could check which gamemodes are always enabled and append this if any are supported) + } + if(cvar("g_tka_on_tdm_maps")) + { + // if this is set, all TDM maps support TKA too + if(!(MapInfo_Map_supportedGametypes & this.m_flags) && (MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_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; diff --git a/qcsrc/server/world.qc b/qcsrc/server/world.qc index b2f3ad7fb0..d86f597b30 100644 --- a/qcsrc/server/world.qc +++ b/qcsrc/server/world.qc @@ -299,7 +299,8 @@ void cvar_changes_init() BADCVAR("g_tdm_on_dm_maps"); BADCVAR("g_tdm_teams"); BADCVAR("g_tka"); - BADCVAR("g_tka_on_dm_maps"); + BADCVAR("g_tka_on_ka_maps"); + BADCVAR("g_tka_on_tdm_maps"); BADCVAR("g_tka_teams"); BADCVAR("g_vip"); BADCVAR("leadlimit");