comparison 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
comparison
equal deleted inserted replaced
0:527e2150eaf0 1:b4856d4d4c4e
141 if (strcmp(file, "-r") == 0) 141 if (strcmp(file, "-r") == 0)
142 file = file_name; 142 file = file_name;
143 143
144 if ((inf = fopen(file, "r")) == NULL) 144 if ((inf = fopen(file, "r")) == NULL)
145 { 145 {
146 perror(file); 146 if (use_savedir && errno == ENOENT)
147 return FALSE; 147 {
148 /* We're using the system savefile and it doesn't exist.
149 * This isn't a fatal error, we'll just start a new game. */
150 return TRUE;
151 }
152 else
153 {
154 perror(file);
155 return FALSE;
156 }
148 } 157 }
149 158
150 fflush(stdout); 159 fflush(stdout);
151 encread(buf, 80, inf); 160 encread(buf, 80, inf);
152 161