unix check_panic_save

Inspired by self-recover, sort of.  Enabled for unix by default; can
be disabled by commenting out '#define CHECK_PANIC_SAVE' in unixconf.h.

When starting the game, if there is no save file to restore and no
lock/level files to recover, check whether a panic save file exists.
If there is one, tell the player that it's there and that it might be
viable, then ask whether to start a new game.

It doesn't convert the panic save into a reconverable one (rename by
nethack, then continue trying to restore) or tell the player how to
make it viable (rename to remove ".e" by game admin), just whether it
is present.  If player opts to start a new game, the panic save is
left alone and will trigger the "there's a panic save file" situation
again once the new game finishes and player starts another.
This commit is contained in:
PatR
2024-03-23 10:11:35 -07:00
parent 4d206c1c40
commit ef17c7ac2b
5 changed files with 129 additions and 16 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 unixconf.h $NHDT-Date: 1607461111 2020/12/08 20:58:31 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.49 $ */
/* NetHack 3.7 unixconf.h $NHDT-Date: 1711213886 2024/03/23 17:11:26 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.57 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Pasi Kallinen, 2018. */
/* NetHack may be freely redistributed. See license for details. */
@@ -118,6 +118,21 @@
#define TIMED_DELAY
#endif
/*
* At start of game, if there are lock and level files for current
* character in the playground directory, ask whether to recover them
* (into a save file).
*/
/* #define SELF_RECOVER */
/*
* At start of game, if there is no save file to restore or lock and
* level files to recover but there is a panic save file for the current
* character, tell the player that it exists and ask whether to start a
* new game. Does not attempt to rename and restore the panic save file.
*/
#define CHECK_PANIC_SAVE
/* #define AVOID_WIN_IOCTL */ /* ensure USE_WIN_IOCTL remains undefined */
/*