Moved env var parsing from get_user_appdata_path to parse_local_save

This commit is contained in:
wunnr
2025-11-03 18:32:03 -07:00
parent a059fd2179
commit d6b3318efb
2 changed files with 11 additions and 9 deletions

View File

@@ -477,15 +477,6 @@ std::string Local_Storage::get_game_settings_path()
std::string Local_Storage::get_user_appdata_path()
{
std::string env_save_path = get_env_variable("GseSavePath");
if (env_save_path.length()) {
if (env_save_path.back() != PATH_SEPARATOR[0]) {
env_save_path = env_save_path.append(PATH_SEPARATOR);
}
return env_save_path;
}
std::string user_appdata_path("SAVE");
#if defined(STEAM_WIN32)
WCHAR szPath[MAX_PATH] = {};

View File

@@ -607,6 +607,17 @@ static uint32 parse_steam_app_id(const std::string &program_path)
// user::saves::local_save_path
static bool parse_local_save(std::string &save_path)
{
std::string env_save_path = get_env_variable("GseSavePath");
if (env_save_path.length()) {
if (env_save_path.back() != *PATH_SEPARATOR) {
env_save_path.push_back(*PATH_SEPARATOR);
}
save_path = env_save_path;
PRINT_DEBUG("using local save path '%s'", save_path.c_str());
return true;
}
auto ptr = ini.GetValue("user::saves", "local_save_path");
if (!ptr || !ptr[0]) return false;