Mercurial > hg > early-roguelike
comparison xrogue/save.c @ 136:1fbdefa82533
xrogue: initial support for the -n option.
The scorefile location is also configurable now.
| author | John "Elwin" Edwards |
|---|---|
| date | Wed, 22 Apr 2015 16:03:00 -0400 |
| parents | ce0cf824c192 |
| children | 443c8bd3e290 |
comparison
equal
deleted
inserted
replaced
| 135:ce0cf824c192 | 136:1fbdefa82533 |
|---|---|
| 149 if (strcmp(file, "-r") == 0) | 149 if (strcmp(file, "-r") == 0) |
| 150 file = file_name; | 150 file = file_name; |
| 151 | 151 |
| 152 if ((inf = open(file, O_RDONLY)) < 0) | 152 if ((inf = open(file, O_RDONLY)) < 0) |
| 153 { | 153 { |
| 154 if (use_savedir && errno == ENOENT) | |
| 155 { | |
| 156 /* No game in progress, so one will be started. */ | |
| 157 return TRUE; | |
| 158 } | |
| 154 perror(file); | 159 perror(file); |
| 155 return(-1); | 160 return FALSE; |
| 156 } | 161 } |
| 157 | 162 |
| 158 fflush(stdout); | 163 fflush(stdout); |
| 159 | 164 |
| 160 encread(buf, strlen(version) + 1, inf); | 165 encread(buf, strlen(version) + 1, inf); |
| 220 wait_for(' '); | 225 wait_for(' '); |
| 221 msg(""); | 226 msg(""); |
| 222 playit(); | 227 playit(); |
| 223 | 228 |
| 224 /*NOTREACHED*/ | 229 /*NOTREACHED*/ |
| 225 return(1); | 230 return FALSE; |
| 226 } | 231 } |
| 227 | 232 |
| 228 #define ENCWBSIZ 1024 | 233 #define ENCWBSIZ 1024 |
| 229 | 234 |
| 230 /* | 235 /* |
