Don't autosave on segfault or after death
This commit is contained in:
parent
2ff3dc0619
commit
67250dfc74
2 changed files with 8 additions and 1 deletions
|
|
@ -252,7 +252,9 @@ md_onsignal_autosave(void)
|
||||||
signal(SIGBUS, auto_save);
|
signal(SIGBUS, auto_save);
|
||||||
#endif
|
#endif
|
||||||
#ifdef SIGSEGV
|
#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
|
#endif
|
||||||
#ifdef SIGSYS
|
#ifdef SIGSYS
|
||||||
signal(SIGSYS, auto_save);
|
signal(SIGSYS, auto_save);
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,11 @@ death(int monst)
|
||||||
time_t date;
|
time_t date;
|
||||||
char buf[80];
|
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);
|
time(&date);
|
||||||
lt = localtime(&date);
|
lt = localtime(&date);
|
||||||
clear();
|
clear();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue