From 0f96ec4a32c321c02e5c3798f96bc454b8c935bf Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Fri, 30 Oct 2009 02:42:40 +0000 Subject: [PATCH] - Fixed: An unspecified save_dir will now save to the program directory on Windows. (Other operating systems already use the user's home directory instead.) SVN r1950 (trunk) --- docs/rh-log.txt | 3 +++ src/g_game.cpp | 11 +++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 2162575de..b76087dfa 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,7 @@ October 29, 2009 +- Fixed: An unspecified save_dir will now save to the program directory on + Windows. (Other operating systems already use the user's home directory + instead.) - Fixed: S_EvictAllChannels() must replace the channel's start time with its position when evicting sounds, because restarting the sound system causes the DSP clock to restart at 0, so start times that were recorded before diff --git a/src/g_game.cpp b/src/g_game.cpp index c617f9804..613b147ba 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1851,14 +1851,11 @@ FString G_BuildSaveName (const char *prefix, int slot) { leader = save_dir; } + if (leader.IsEmpty()) + { #ifdef unix - if (leader.IsEmpty()) - { leader = "~/" GAME_DIR; - } #elif defined(__APPLE__) - if (leader.IsEmpty()) - { char cpath[PATH_MAX]; FSRef folder; @@ -1867,8 +1864,10 @@ FString G_BuildSaveName (const char *prefix, int slot) { leader << cpath << "/" GAME_DIR "/Savegames/"; } - } +#else + leader = progdir; #endif + } } size_t len = leader.Len(); if (leader[0] != '\0' && leader[len-1] != '\\' && leader[len-1] != '/')