commit 084587ecb43ea3acdc43db3f583d657ff0219b2a
Author: Simon Howard <fraggle@gmail.com>
AuthorDate: Sun Oct 19 17:02:26 2014 -0400
Commit: Simon Howard <fraggle@gmail.com>
CommitDate: Sun Oct 19 17:02:26 2014 -0400
doom: Write -cdrom savegames to c:\doomdata.
When using the -cdrom command line parameter (does anyone still use
that?), savegames should be written to c:\doomdata to properly
reproduce Vanilla behavior. These were being incorrectly written to
c:\doomdata\savegames\foo.wad instead.
This fixes #175. Thanks Alexandre-Xavier.
---
src/doom/d_main.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/doom/d_main.c b/src/doom/d_main.c
index 733a11fb..c7987b90 100644
--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -1250,7 +1250,7 @@ void D_DoomMain (void)
// allowing play from CD.
//
- if (M_CheckParm("-cdrom") > 0)
+ if (M_ParmExists("-cdrom"))
{
printf(D_CDROM);
@@ -1263,7 +1263,7 @@ void D_DoomMain (void)
M_SetConfigDir(NULL);
}
-
+
//!
// @arg <x>
// @vanilla
@@ -1468,7 +1468,18 @@ void D_DoomMain (void)
// Set the gamedescription string. This is only possible now that
// we've finished loading Dehacked patches.
D_SetGameDescription();
- savegamedir = M_GetSaveGameDir(D_SaveGameIWADName(gamemission));
+
+#ifdef _WIN32
+ // In -cdrom mode, we write savegames to c:\doomdata as well as configs.
+ if (M_ParmExists("-cdrom"))
+ {
+ savegamedir = configdir;
+ }
+ else
+#endif
+ {
+ savegamedir = M_GetSaveGameDir(D_SaveGameIWADName(gamemission));
+ }
// Check for -file in shareware
if (modifiedgame)