Merge pull request #200 from JariKCoding/main

fix: initial config.cfg now gets created and dvar strings now get written correctly
This commit is contained in:
Maurice Heumann 2023-02-18 20:26:08 +01:00 committed by GitHub
commit a346877bac

View File

@ -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);