From 56d345731f601de72628d7338f0b6946af3dc6fb Mon Sep 17 00:00:00 2001 From: k9er Date: Tue, 8 Oct 2024 18:12:57 +0000 Subject: [PATCH] Add cl_autodemo_delete_keepmatches cvar Similar to `cl_autodemo_delete_keeprecords`, doesn't delete any demos where the player joined the match. Useful for non-race non-cts gamemodes. --- qcsrc/client/main.qc | 8 ++++++++ qcsrc/client/main.qh | 2 ++ qcsrc/common/gamemodes/gamemode/race/cl_race.qh | 1 - xonotic-client.cfg | 3 ++- 4 files changed, 12 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 9cf0185ed..85c7a9a05 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -905,6 +905,14 @@ NET_HANDLE(ENT_CLIENT_SPAWNEVENT, bool is_new) // local spawn actions if(is_new && (!entnum || (entnum == player_localentnum))) { + if(!spectatee_status) + if(autocvar_cl_autodemo_delete_keepmatches >= 2 || (!warmup_stage && autocvar_cl_autodemo_delete_keepmatches == 1)) + { + float del = autocvar_cl_autodemo_delete; + del &= ~1; + cvar_set("cl_autodemo_delete", ftos(del)); // don't delete demo where the player joined the match + } + if(autocvar_cl_spawnzoom && !autocvar_cl_lockview) { zoomin_effect = 1; diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh index 8b96b0833..6ecc2e036 100644 --- a/qcsrc/client/main.qh +++ b/qcsrc/client/main.qh @@ -30,6 +30,8 @@ AUTOCVAR_SAVE(cl_race_checkpoint_splits_hud, bool, 1, "Show race checkpoint spli bool autocvar_cl_race_cptimes_onlyself; // TODO: move to race gamemode bool autocvar_cl_race_cptimes_showself = false; bool autocvar_cl_welcome = true; +bool autocvar_cl_autodemo_delete; +bool autocvar_cl_autodemo_delete_keepmatches; bool autocvar_menu_gamemenu = true; // Map coordinate base calculations need these diff --git a/qcsrc/common/gamemodes/gamemode/race/cl_race.qh b/qcsrc/common/gamemodes/gamemode/race/cl_race.qh index 43d16b0a5..b6765e909 100644 --- a/qcsrc/common/gamemodes/gamemode/race/cl_race.qh +++ b/qcsrc/common/gamemodes/gamemode/race/cl_race.qh @@ -1,6 +1,5 @@ #pragma once -bool autocvar_cl_autodemo_delete; bool autocvar_cl_autodemo_delete_keeprecords; void HUD_Mod_Race(vector pos, vector mySize); diff --git a/xonotic-client.cfg b/xonotic-client.cfg index 0abbcd72b..7872f40c1 100644 --- a/xonotic-client.cfg +++ b/xonotic-client.cfg @@ -822,7 +822,8 @@ set cl_lerpanim_maxdelta_framegroups 0.05 // must be faster than fastest weapon set cl_lerpanim_maxdelta_server 0.1 // must be slower than slowest server controlled anim (e.g. animinfo stuff) // autodemo deleting -seta cl_autodemo_delete_keeprecords 0 "when 1, records with a newly made race/cts demo are kept even if cl_autodemo_delete is used to delete demos" +seta cl_autodemo_delete_keeprecords 0 "keep demos with a newly made Race/CTS record even if cl_autodemo_delete is used to delete demos" +seta cl_autodemo_delete_keepmatches 0 "keep demos of matches you join even if cl_autodemo_delete is used to delete demos, 2 = even if you only joined during warmup" // freeze camera set cl_lockview 0 "when 1, the camera does not move any more; when 2, you can only control camera angles" -- 2.39.2