From df6ef9752a1c578bee9d678bb58dde118f81b6be Mon Sep 17 00:00:00 2001 From: Alug Date: Sun, 8 Sep 2024 23:33:54 +0200 Subject: [PATCH] turn off director by default when playing replays and restore the setting when done you can still toggle it in replays no issues but you mostly want to watch yourself or a certain person during replays, so having to manually toggle it off always is weird --- src/g_game.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/g_game.c b/src/g_game.c index 8e047b78b..7e6fa2613 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -336,6 +336,10 @@ boolean precache = true; // if true, load all graphics at start INT16 prevmap, nextmap; +// save if director is enabled +// so demos can disable it by default and restore it after +int directorstate = 0; + static CV_PossibleValue_t recordmultiplayerdemos_cons_t[] = {{0, "Disabled"}, {1, "Manual Save"}, {2, "Auto Save"}, {0, NULL}}; consvar_t cv_recordmultiplayerdemos = {"netdemo_record", "Manual Save", CV_SAVE, recordmultiplayerdemos_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; @@ -7723,6 +7727,9 @@ post_compat: players[i].kartweight = kartweight[i]; } + directorstate = cv_director.value; + CV_SetValue(&cv_director, 0); + demo.deferstart = true; } #undef SKIPERRORS @@ -8289,6 +8296,11 @@ void G_StopDemo(void) { Z_Free(demobuffer); demobuffer = NULL; + if (demo.playback) + { + CV_SetValue(&cv_director, directorstate); + directorstate = 0; + } demo.playback = false; if (demo.title) modeattacking = false;