From 5c86ad850731bfb080c08499320c542d90f26707 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 23 May 2020 09:08:40 -0400 Subject: [PATCH] - defcvars: handle values from a version 219 config --- src/d_main.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index c4673ece6..3a59e5d1d 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -353,6 +353,7 @@ void D_GrabCVarDefaults() sc.ScriptError("Version must be at least 219 (current version %i)", gamelastrunversion); FBaseCVar* var; + FString CurrentFindCVar; while (sc.GetString()) { @@ -360,7 +361,30 @@ void D_GrabCVarDefaults() { sc.MustGetString(); } - var = FindCVar(sc.String, NULL); + + CurrentFindCVar = sc.String; + + if (lumpversion < 220) + { + CurrentFindCVar.ToLower(); + + // these two got renamed + if (strcmp(CurrentFindCVar, "gamma") == 0) + { + CurrentFindCVar = "vid_gamma"; + } + if (strcmp(CurrentFindCVar, "fullscreen") == 0) + { + CurrentFindCVar = "vid_fullscreen"; + } + + // this was removed + if (strcmp(CurrentFindCVar, "cd_drive") == 0) + break; + } + + var = FindCVar(CurrentFindCVar, NULL); + if (var != NULL) { if (var->GetFlags() & CVAR_ARCHIVE)