]> granicus.if.org Git - nethack/commitdiff
entering discover mode while restoring a game
authorcohrs <cohrs>
Fri, 7 Jun 2002 21:24:52 +0000 (21:24 +0000)
committercohrs <cohrs>
Fri, 7 Jun 2002 21:24:52 +0000 (21:24 +0000)
Reported directly to the list.  If you are not the wizard and start nethack
on the command line with the -D flag (or -X), the game reports that you're
entering discover mode but does not actually do it.  The flags.explore in
the save file overwrote the new value.  Save the flag while reading flags
if discover mode was requested.

doc/fixes34.1
src/restore.c

index 954cafce73dbd40b0515946b98912ae2ed93e2a1..076364f1c392b28b29831e8acaee2ec90d78fa1e 100644 (file)
@@ -116,6 +116,8 @@ Staff of Aesculapius did not always cure sliming
 correct singularization of fungi, liches, vortices
 prevent "remove_object: obj not on floor" panic for iron ball placement if
        riding while punished leads to a fall off steed when changing levels
+specifying -D (or -X) to enter explore mode while restarting from a save
+       file was lost in the restore process
 
 
 Platform- and/or Interface-Specific Fixes
index 5522aa04232cbb8e1fb3278978bfdcdae5712b99..d7c72c11b488fb1305326da411b787bd37eacd98 100644 (file)
@@ -355,6 +355,8 @@ restgamestate(fd, stuckid, steedid)
 register int fd;
 unsigned int *stuckid, *steedid;       /* STEED */
 {
+       /* discover is actually flags.explore */
+       boolean remember_discover = discover;
        struct obj *otmp;
        int uid;
 
@@ -371,6 +373,7 @@ unsigned int *stuckid, *steedid;    /* STEED */
 
        mread(fd, (genericptr_t) &flags, sizeof(struct flag));
        flags.bypasses = 0;     /* never use the saved value of bypasses */
+       if (remember_discover) discover = remember_discover;
 
        role_init();    /* Reset the initial role, race, gender, and alignment */
 #ifdef AMII_GRAPHICS