caller couldn't find a regular save file but did find a panic one */
| 260 | |
| 261 | /* caller couldn't find a regular save file but did find a panic one */ |
| 262 | void |
| 263 | ask_about_panic_save(void) |
| 264 | { |
| 265 | #ifdef CHECK_PANIC_SAVE |
| 266 | static const char Instead_prompt[] = "Start a new game instead?"; |
| 267 | int c = '\0'; |
| 268 | |
| 269 | pline("There is no regular save file but there is a panic one."); |
| 270 | pline("It might be recoverable with demi-divine intervention."); |
| 271 | if (iflags.window_inited) { |
| 272 | c = yn_function(Instead_prompt, "yn\033q", 'n', FALSE); |
| 273 | } else { |
| 274 | raw_printf("%s [yn] (n) ", Instead_prompt); |
| 275 | (void) fflush(stdout); |
| 276 | do { |
| 277 | c = getchar(); |
| 278 | if (c == EOF || c == '\033' || c == '\0') |
| 279 | break; |
| 280 | c = lowc(c); |
| 281 | } while (!strchr("ynq\n", c)); |
| 282 | } |
| 283 | if (c != 'y') { |
| 284 | /* caller successfully called getlock() and made <levelfile>.0 */ |
| 285 | delete_levelfile(0); |
| 286 | unlock_file(HLOCK); /* just in case, release 'perm' */ |
| 287 | if (iflags.window_inited) |
| 288 | exit_nhwindows((char *) 0); |
| 289 | nh_terminate(EXIT_SUCCESS); |
| 290 | } |
| 291 | #endif |
| 292 | return; /* proceed with new game */ |
| 293 | } |
| 294 | |
| 295 | /* normalize file name - we don't like .'s, /'s, spaces */ |
| 296 | void |
no test coverage detected