summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player-stats.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2012-11-21 15:04:46 +0100
committerAdam Borowski <kilobyte@angband.pl>2012-11-21 15:04:46 +0100
commit4676d1638a5d5d928bebc4727b0031b1e90c109d (patch)
treec403135ce7999ab4dbbb169b381a8d0a1698338c /crawl-ref/source/player-stats.cc
parent58457ea65098736276e7220cc4eec07c3b9abf39 (diff)
downloadcrawl-ref-4676d1638a5d5d928bebc4727b0031b1e90c109d.tar.gz
crawl-ref-4676d1638a5d5d928bebc4727b0031b1e90c109d.zip
Fix possible save corruption when disconnecting on the stat gain prompt.
While actual corruption is quite unlikely, at the very least the turn will be ended at an arbitrary moment, before all actors get to move.
Diffstat (limited to 'crawl-ref/source/player-stats.cc')
-rw-r--r--crawl-ref/source/player-stats.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/crawl-ref/source/player-stats.cc b/crawl-ref/source/player-stats.cc
index bb25251da4..d9b6032061 100644
--- a/crawl-ref/source/player-stats.cc
+++ b/crawl-ref/source/player-stats.cc
@@ -74,7 +74,7 @@ static void _handle_stat_change(stat_type stat, const char *aux = NULL,
bool see_source = true);
static void _handle_stat_change(const char *aux = NULL, bool see_source = true);
-void attribute_increase()
+bool attribute_increase()
{
crawl_state.stat_gain_prompt = true;
#ifdef TOUCH_UI
@@ -115,27 +115,27 @@ void attribute_increase()
switch (keyin)
{
CASE_ESCAPE
- // [ds] It's safe to save the game here; when the player
- // reloads, the game will re-prompt for their level-up
- // stat gain.
+ // It is unsafe to save the game here; continue with the turn
+ // normally, when the player reloads, the game will re-prompt
+ // for their level-up stat gain.
if (crawl_state.seen_hups)
- sighup_save_and_exit();
+ return false;
break;
case 's':
case 'S':
modify_stat(STAT_STR, 1, false, "level gain");
- return;
+ return true;
case 'i':
case 'I':
modify_stat(STAT_INT, 1, false, "level gain");
- return;
+ return true;
case 'd':
case 'D':
modify_stat(STAT_DEX, 1, false, "level gain");
- return;
+ return true;
#ifdef TOUCH_UI
default:
status->text = "Please choose an option below"; // too naggy?