]> granicus.if.org Git - nethack/commitdiff
umpteenth hangup bit
authornethack.rankin <nethack.rankin>
Sun, 11 Feb 2007 03:36:15 +0000 (03:36 +0000)
committernethack.rankin <nethack.rankin>
Sun, 11 Feb 2007 03:36:15 +0000 (03:36 +0000)
     From a bug report:  hangup during
screen updating at tail end of successful restore didn't create a new
save file when disconnecting.  Use his suggestion for moving the setting
of program_state.something_worth_saving sooner, before the save file is
deleted.  To do that, restlevelstate() needs to come sooner too.  I think
this is safe enough to include in the branch code.

     For the trunk, I'm not sure whether the SAFERHANGUP config will work
well here.  It has to survive long enough under autopilot to enter moveloop
before the chance to save kicks in.

src/restore.c

index 685a0ac716cf328c0b46671a42c6969f9ae52dcf..c45ab97ea502f7ad71efaed5a5b28e225baf8e04 100644 (file)
@@ -829,6 +829,9 @@ register int fd;
         */
        reset_restpref();
 
+       restlevelstate(stuckid, steedid);
+       program_state.something_worth_saving = 1; /* useful data now exists */
+
        if (!wizard && !discover)
                (void) delete_savefile();
 #ifdef REINCARNATION
@@ -837,7 +840,6 @@ register int fd;
 #ifdef USE_TILES
        substitute_tiles(&u.uz);
 #endif
-       restlevelstate(stuckid, steedid);
 #ifdef MFLOPPY
        gameDiskPrompt();
 #endif
@@ -864,7 +866,6 @@ register int fd;
        docrt();
        restoring = FALSE;
        clear_nhwindow(WIN_MESSAGE);
-       program_state.something_worth_saving++; /* useful data now exists */
 
        /* Success! */
        welcome(FALSE);