diff --git a/rogue3/mdport.c b/rogue3/mdport.c index 03702dd..3c08b18 100644 --- a/rogue3/mdport.c +++ b/rogue3/mdport.c @@ -252,7 +252,9 @@ md_onsignal_autosave(void) signal(SIGBUS, auto_save); #endif #ifdef SIGSEGV - signal(SIGSEGV, auto_save); + /* If there's a segfault, the game state is probably trashed + and there's no point saving it. */ + signal(SIGSEGV, SIG_DFL); #endif #ifdef SIGSYS signal(SIGSYS, auto_save); diff --git a/rogue3/rip.c b/rogue3/rip.c index 1967231..84731e6 100644 --- a/rogue3/rip.c +++ b/rogue3/rip.c @@ -55,6 +55,11 @@ death(int monst) time_t date; char buf[80]; + /* Don't autosave dead games. It would be a good idea to autosave a + game that is between death and scoreboard write, but the restore + code can't handle that case yet. */ + md_onsignal_default(); + time(&date); lt = localtime(&date); clear();