shithub: choc

Download patch

ref: 084587ecb43ea3acdc43db3f583d657ff0219b2a
parent: 16c56ea0c4476f4d908a4f8073cab48cdfe43005
author: Simon Howard <[email protected]>
date: Sun Oct 19 13:02:26 EDT 2014

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.

--- a/src/doom/d_main.c
+++ b/src/doom/d_main.c
@@ -1250,7 +1250,7 @@
     // allowing play from CD.
     //
 
-    if (M_CheckParm("-cdrom") > 0)
+    if (M_ParmExists("-cdrom"))
     {
         printf(D_CDROM);
 
@@ -1263,7 +1263,7 @@
 
         M_SetConfigDir(NULL);
     }
-    
+
     //!
     // @arg <x>
     // @vanilla
@@ -1468,7 +1468,18 @@
     // 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)