From bba4efda62aecbc8f1f68561486295b3966676b4 Mon Sep 17 00:00:00 2001 From: Jari van der Kaap Date: Sat, 18 Feb 2023 20:19:09 +0100 Subject: [PATCH] fix: initial config.cfg now gets created and dvar strings now get written correctly --- src/client/component/dvars.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/component/dvars.cpp b/src/client/component/dvars.cpp index 40703391..c6f67d02 100644 --- a/src/client/component/dvars.cpp +++ b/src/client/component/dvars.cpp @@ -41,7 +41,7 @@ namespace dvars auto name = dvar->debugName; auto value = game::Dvar_DisplayableValue(dvar); - config_buffer.append(utils::string::va("set %s %s\n", name, value)); + config_buffer.append(utils::string::va("set %s \"%s\"\n", name, value)); } if (config_buffer.length() == 0) @@ -65,7 +65,10 @@ namespace dvars const std::string path = get_config_file_path(); if (!utils::io::file_exists(path)) + { + initial_config_read = true; return; + } std::string filedata; utils::io::read_file(path, &filedata);