From 01050be22663460377e055faea7fee9e9b959734 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 2 Feb 2020 17:06:13 +0200 Subject: [PATCH] - added save_dir CVAR to customize saved games path --- source/common/savegamehelp.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/source/common/savegamehelp.cpp b/source/common/savegamehelp.cpp index 663bb2718..f680738ad 100644 --- a/source/common/savegamehelp.cpp +++ b/source/common/savegamehelp.cpp @@ -53,6 +53,8 @@ static FResourceFile *savereader; void LoadEngineState(); void SaveEngineState(); +CVAR(String, save_dir, "", CVAR_ARCHIVE|CVAR_GLOBALCONFIG); + //============================================================================= // // This is for keeping my sanity while working with the horrible mess @@ -342,7 +344,9 @@ int G_ValidateSavegame(FileReader &fr, FString *savetitle, bool formenu) FString G_BuildSaveName (const char *prefix) { - FString name = M_GetSavegamesPath(); + FString name = *save_dir; + if (name.IsEmpty()) + name = M_GetSavegamesPath(); size_t len = name.Len(); if (name[0] != '\0' && name[len-1] != '\\' && name[len-1] != '/') { @@ -512,4 +516,4 @@ void LoadEngineState() fr.Close(); } -} \ No newline at end of file +}