nethack -X vs normal game (trunk only)
Reported to the beta-testers list by <Someone> last April: restoring a normal game save file in explore mode let you keep the file, then after exploring and quitting without saving, you could restore it again in normal mode and take advantage of whatever information you'd gained. This makes nethack -X (or playmode:explore) defer the switch to explore mode when used while restoring a normal mode save file. It now performs a normal restore (with save file deletion) and then acts as if the user had given the 'X' command interactively, requiring confirmation to actually switch into explore mode.
This commit is contained in:
@@ -544,11 +544,13 @@ unsigned int *stuckid, *steedid; /* STEED */
|
||||
newgameflags = flags;
|
||||
mread(fd, (genericptr_t) &flags, sizeof(struct flag));
|
||||
/* wizard and discover are actually flags.debug and flags.explore;
|
||||
player might be overriding the save file values for them */
|
||||
if (newgameflags.explore) discover = TRUE;
|
||||
player might be overriding the save file values for them;
|
||||
in the discover case, we don't want to set that for a normal
|
||||
game until after the save file has been removed */
|
||||
iflags.deferred_X = (newgameflags.explore && !discover);
|
||||
if (newgameflags.debug) {
|
||||
/* authorized by startup code; wizard mode exists and is allowed */
|
||||
wizard = TRUE, discover = FALSE;
|
||||
wizard = TRUE, discover = iflags.deferred_X = FALSE;
|
||||
} else if (wizard) {
|
||||
/* specified by save file; check authorization now */
|
||||
set_playmode();
|
||||
@@ -577,6 +579,7 @@ unsigned int *stuckid, *steedid; /* STEED */
|
||||
u.uz.dnum = 0;
|
||||
u.uz.dlevel = 1;
|
||||
/* revert to pre-restore option settings */
|
||||
iflags.deferred_X = FALSE;
|
||||
flags = newgameflags;
|
||||
#ifdef SYSFLAGS
|
||||
sysflags = newgamesysflags;
|
||||
|
||||
Reference in New Issue
Block a user