diff --git a/docs/rh-log.txt b/docs/rh-log.txt index c370b35e2..a2dd16e97 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,10 @@ March 4, 2009 +- Fixed: You couldn't easily play with the compatibility options menu during + the title screen, because the demo loop reset the server cvars after each + attempt to play a demo, even though the demos never actually played. The + proper long-term solution would be to make shadow copies of all cvars + touched by demos and use those for the demo and the real things for + everything else, but this should do for now and is a lot easier. - Fixed: When using BOOM-style sector flags and specials together, the special was ignored unless it was "secret". - Fixed: One byte is too short for DUMB_IT_SIGRENDERER to store song tempo. diff --git a/src/c_cvars.cpp b/src/c_cvars.cpp index 7459ba0b3..244457027 100644 --- a/src/c_cvars.cpp +++ b/src/c_cvars.cpp @@ -1299,6 +1299,17 @@ void C_RestoreCVars (void) for (i = numbackedup; i; i--, backup++) { cvar_set (backup->name, backup->string); + } + C_ForgetCVars(); +} + +void C_ForgetCVars (void) +{ + struct backup_s *backup = CVarBackups; + int i; + + for (i = numbackedup; i; i--, backup++) + { delete[] backup->name; delete[] backup->string; backup->name = backup->string = NULL; diff --git a/src/c_cvars.h b/src/c_cvars.h index a424c8157..c801cece7 100644 --- a/src/c_cvars.h +++ b/src/c_cvars.h @@ -387,6 +387,8 @@ inline FBaseCVar *cvar_forceset (const char *var_name, const BYTE *value) { retu // that might possibly have been changed during the course of demo playback. void C_RestoreCVars (void); +void C_ForgetCVars (void); + #define CUSTOM_CVAR(type,name,def,flags) \ static void cvarfunc_##name(F##type##CVar &); \ diff --git a/src/g_game.cpp b/src/g_game.cpp index 343184b4d..8e7032499 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -2400,7 +2400,7 @@ void G_DoPlayDemo (void) { const char *eek = "Cannot play non-ZDoom demos.\n(They would go out of sync badly.)\n"; - C_RestoreCVars(); + C_ForgetCVars(); M_Free(demobuffer); demo_p = demobuffer = NULL; if (singledemo) @@ -2421,7 +2421,6 @@ void G_DoPlayDemo (void) } else { - // don't spend a lot of time in loadlevel precache = false; demonew = true;