From aa97ea65b17a8d14d5c70151b3453f148a1c9e00 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Sun, 11 Feb 2007 03:36:15 +0000 Subject: [PATCH] umpteenth hangup bit 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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/restore.c b/src/restore.c index 685a0ac71..c45ab97ea 100644 --- a/src/restore.c +++ b/src/restore.c @@ -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);