diff options
author | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2009-10-22 18:01:44 +0530 |
---|---|---|
committer | Darshan Shaligram <dshaligram@users.sourceforge.net> | 2009-10-22 18:04:04 +0530 |
commit | 7bfdcb1598177d1bf68e73007020321ed23f67dc (patch) | |
tree | ed8c42db2b41ddb30b692e87227f8f0f4dba6c69 /crawl-ref/source/player.cc | |
parent | 9ae7a2dccc9934bc62f233547976edee461ebdf2 (diff) | |
download | crawl-ref-7bfdcb1598177d1bf68e73007020321ed23f67dc.tar.gz crawl-ref-7bfdcb1598177d1bf68e73007020321ed23f67dc.zip |
Fix Crawl pegging CPU when it sees HUP at the level-up stat gain prompt.
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r-- | crawl-ref/source/player.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc index ea9b516513..eec79c0d66 100644 --- a/crawl-ref/source/player.cc +++ b/crawl-ref/source/player.cc @@ -3820,6 +3820,17 @@ static void _attribute_increase() switch (keyin) { +#if defined(USE_UNIX_SIGNALS) && defined(SIGHUP_SAVE) + case ESCAPE: + case -1: + // [ds] It's safe to save the game here; when the player + // reloads, the game will re-prompt for their level-up + // stat gain. + if (crawl_state.seen_hups) + sighup_save_and_exit(); + break; +#endif + case 's': case 'S': modify_stat(STAT_STRENGTH, 1, false, "level gain"); |