]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
-deathmatch_force_teamplay; +g_tdm_on_dm_maps
authorRudolf Polzer <divverent@alientrap.org>
Tue, 6 Dec 2011 13:15:03 +0000 (14:15 +0100)
committerRudolf Polzer <divverent@alientrap.org>
Tue, 6 Dec 2011 13:15:03 +0000 (14:15 +0100)
defaultXonotic.cfg
qcsrc/common/mapinfo.qc
qcsrc/server/autocvars.qh
qcsrc/server/teamplay.qc

index 7c66a31a64c71cf042afcc4da44506cb740f3c7a..03573ca5da144646f3a0048e5b76f14e7d7b5e19 100644 (file)
@@ -711,6 +711,7 @@ seta timelimit_suddendeath 5 "number of minutes suddendeath mode lasts after all
 
 // common team values
 set g_tdm 0 "Team Deathmatch: the team who kills their opponents most often wins"
+set g_tdm_on_dm_maps 0 "when this is set, all DM maps automatically support TDM"
 
 seta teamplay_mode 4 "default teamplay setting in team games. 1 = no friendly fire, self damage. 2 = friendly fire and self damage enabled. 3 = no friendly fire, but self damage enabled. 4 = obey the following four cvars"
 seta g_mirrordamage 0.700000   "for teamplay 4: mirror damage factor"
@@ -721,7 +722,6 @@ seta g_friendlyfire_virtual_force 1 "for teamplay 4: apply force even though dam
 seta g_teamdamage_threshold 40 "for teamplay 4: threshold over which to apply mirror damage"
 seta g_teamdamage_resetspeed 20        "for teamplay 4: how fast player's teamdamage count decreases"
 
-set deathmatch_force_teamplay 0        "Always play TDM instead of DM"
 seta g_balance_teams 0 "automatically balance out players entering instead of asking them for their preferred team"
 seta g_balance_teams_force 0   "automatically balance out teams when players move or disconnect"
 seta g_balance_teams_prevent_imbalance 0       "prevent players from changing to larger teams"
index 4ec54b0f06ace8cd5773fa846296ccda602b23ca..e44e2bc7efcdaf689b73c1c5cc1bbca084043eec 100644 (file)
@@ -78,6 +78,7 @@ float MapInfo_Cache_Retrieve(string map)
        MapInfo_Map_supportedGametypes = stof(bufstr_get(_MapInfo_Cache_Buf_IndexToMapData, ++i));
        MapInfo_Map_supportedFeatures = stof(bufstr_get(_MapInfo_Cache_Buf_IndexToMapData, ++i));
        MapInfo_Map_flags = stof(bufstr_get(_MapInfo_Cache_Buf_IndexToMapData, ++i));
+
        return 1;
 }
 
@@ -830,7 +831,7 @@ float MapInfo_isRedundant(string fn, string t)
 }
 
 // load info about a map by name into the MapInfo_Map_* globals
-float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametypeToSet)
+float MapInfo_Get_ByName_NoFallbacks(string pFilename, float pAllowGenerate, float pGametypeToSet)
 {
        string fn;
        string s, t;
@@ -1088,16 +1089,6 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype
        }
        fclose(fh);
 
-       if(pGametypeToSet)
-       {
-               if(!(MapInfo_Map_supportedGametypes & pGametypeToSet))
-               {
-                       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;
-               }
-       }
-
        if(MapInfo_Map_title == "<TITLE>")
                MapInfo_Map_titlestring = MapInfo_Map_bspname;
        else if(MapInfo_isRedundant(MapInfo_Map_bspname, MapInfo_Map_title))
@@ -1111,6 +1102,32 @@ float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametype
        dprint("Map ", pFilename, " supports no game types, ignored\n");
        return 0;
 }
+float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, float pGametypeToSet)
+{
+       float r = MapInfo_Get_ByName_NoFallbacks(pFilename, pAllowGenerate, pGametypeToSet);
+
+#ifdef SVQC
+       if(autocvar_g_tdm_on_dm_maps)
+       {
+               // if this is set, all DM maps support TDM too
+               if not(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_TEAM_DEATHMATCH)
+                       if(MapInfo_Map_supportedGametypes & MAPINFO_TYPE_DEATHMATCH)
+                               _MapInfo_Map_ApplyGametypeEx ("", pGametypeToSet, MAPINFO_TYPE_TEAM_DEATHMATCH);
+       }
+#endif
+
+       if(pGametypeToSet)
+       {
+               if(!(MapInfo_Map_supportedGametypes & pGametypeToSet))
+               {
+                       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;
+               }
+       }
+
+       return r;
+}
 
 float MapInfo_FindName(string s)
 {
index 175d6dcf16e73fa7695ee530dbb759f186fb9935..9e1bebc03775aff2fecc71485fcdb63957f2a2ca 100644 (file)
@@ -61,7 +61,6 @@ float autocvar_bot_debug_goalstack;
 float autocvar_bot_wander_enable;
 float autocvar_captureleadlimit_override;
 #define autocvar_capturelimit_override cvar("capturelimit_override")
-float autocvar_deathmatch_force_teamplay;
 #define autocvar_developer cvar("developer")
 float autocvar_developer_fteqccbugs;
 float autocvar_ekg;
@@ -1216,3 +1215,4 @@ float autocvar_g_sandbox_object_scale_min;
 float autocvar_g_sandbox_object_scale_max;
 float autocvar_g_sandbox_object_material_velocity_min;
 float autocvar_g_sandbox_object_material_velocity_factor;
+float autocvar_g_tdm_on_dm_maps;
index 173e6ec270e2b27b3247613a7ad18938a9ef1841..3d65d760d3af9604921342e4b811dc6619329d0c 100644 (file)
@@ -143,12 +143,6 @@ void ReadGameCvars()
        if(!found)
                g_dm = 1;
 
-       if(g_dm && autocvar_deathmatch_force_teamplay)
-       {
-               g_dm = 0;
-               g_tdm = 1;
-       }
-
        teamplay = 0;
        serverflags &~= SERVERFLAG_TEAMPLAY;
 }
@@ -257,8 +251,7 @@ void InitGameplayMode()
        {
                game = GAME_RUNEMATCH;
                gamemode_name = "Rune Match";
-               if(autocvar_deathmatch_force_teamplay)
-                       ActivateTeamplay();
+               // ActivateTeamplay();
                fraglimit_override = autocvar_g_runematch_point_limit;
                leadlimit_override = autocvar_g_runematch_point_leadlimit;
                runematch_init();