diff rogue3/save.c @ 1:b4856d4d4c4e

Add -n option and system savedir functionality
author edwarj4
date Wed, 14 Oct 2009 01:32:13 +0000
parents 527e2150eaf0
children e676d52b5d09
line wrap: on
line diff
--- a/rogue3/save.c	Tue Oct 13 13:33:34 2009 +0000
+++ b/rogue3/save.c	Wed Oct 14 01:32:13 2009 +0000
@@ -143,8 +143,17 @@
 
     if ((inf = fopen(file, "r")) == NULL)
     {
-	perror(file);
-	return FALSE;
+        if (use_savedir && errno == ENOENT)
+        {
+          /* We're using the system savefile and it doesn't exist. 
+           * This isn't a fatal error, we'll just start a new game. */
+          return TRUE;
+        }
+        else
+        {
+	  perror(file);
+	  return FALSE;
+        }
     }
 
     fflush(stdout);