move 'g.restoring' to 'g.program_state.restoring'

Move the core's global restoring flag (not the same as main()'s
local resuming flag) to a more logical place.  Add a saving flag
in the process, but it isn't being set or cleared anywhere yet.
(Once in use it will probably fix the exception during save that
was just reported, but before that it would be useful to figure
out what specifically caused the event.)

The program_state struct really ought to be standalone rather
than part of struct g but I haven't made that change.

Removing an unused variable for wishing and some reformatting
that whent along with it got mixed in.  Removes some trailing
whitespace in sfstruct.c too.

Only lightly tested...
This commit is contained in:
PatR
2020-11-30 11:40:21 -08:00
parent 30b59acc40
commit f8fcab3400
10 changed files with 59 additions and 47 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 decl.h $NHDT-Date: 1600468452 2020/09/18 22:34:12 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.242 $ */
/* NetHack 3.7 decl.h $NHDT-Date: 1606765210 2020/11/30 19:40:10 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.246 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Michael Allison, 2007. */
/* NetHack may be freely redistributed. See license for details. */
@@ -94,6 +94,8 @@ struct sinfo {
int something_worth_saving; /* in case of panic */
int panicking; /* `panic' is in progress */
int exiting; /* an exit handler is executing */
int saving;
int restoring;
int in_moveloop;
int in_impossible;
int in_self_recover;