diff options
author | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-25 20:26:28 +0000 |
---|---|---|
committer | haranp <haranp@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-01-25 20:26:28 +0000 |
commit | 7cfe05ee417670c6a409cb4beb999be06a01e301 (patch) | |
tree | 07ca4ddc0d82aa94d81d45dda0aa28f584d1b02e /crawl-ref | |
parent | 304f59e923fea980d145397d57af5f0979936aef (diff) | |
download | crawl-ref-7cfe05ee417670c6a409cb4beb999be06a01e301.tar.gz crawl-ref-7cfe05ee417670c6a409cb4beb999be06a01e301.zip |
Fix repeated messages when getting HP/MP restored interrupts with
multiple delays queued (e.g., when butchering several items.)
However, this fix means that Lua can't suppress the "HP restored"
message on the relevant interrupt. If this is a problem it should
be changed.
Fixes [2494104].
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8749 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r-- | crawl-ref/source/delay.cc | 16 | ||||
-rw-r--r-- | crawl-ref/source/state.cc | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc index bc99032034..73f9b9ff86 100644 --- a/crawl-ref/source/delay.cc +++ b/crawl-ref/source/delay.cc @@ -1740,14 +1740,6 @@ static bool _should_stop_activity(const delay_queue_item &item, if (ai == AI_FULL_HP || ai == AI_FULL_MP) { - // No recursive interruptions from messages (AI_MESSAGE) - _block_interruptions(true); - if (ai == AI_FULL_HP) - mpr("HP restored."); - else - mpr("Magic restored."); - _block_interruptions(false); - if (Options.rest_wait_both && curr == DELAY_REST && (you.magic_points < you.max_magic_points || you.hp < you.hp_max)) @@ -1920,6 +1912,14 @@ bool interrupt_activity( activity_interrupt_type ai, // First try to stop the current delay. const delay_queue_item &item = you.delay_queue.front(); + // No recursive interruptions from messages (AI_MESSAGE) + _block_interruptions(true); + if (ai == AI_FULL_HP) + mpr("HP restored."); + else if (ai == AI_FULL_MP) + mpr("Magic restored."); + _block_interruptions(false); + if (_should_stop_activity(item, ai, at)) { // no monster will attack you inside a sanctuary, diff --git a/crawl-ref/source/state.cc b/crawl-ref/source/state.cc index 682119512b..d63fa8f201 100644 --- a/crawl-ref/source/state.cc +++ b/crawl-ref/source/state.cc @@ -215,7 +215,7 @@ bool interrupt_cmd_repeat( activity_interrupt_type ai, return (true); } - // If command repitition is being used to immitate the rest command, + // If command repetition is being used to imitate the rest command, // then everything interrupts it. if (crawl_state.repeat_cmd == CMD_MOVE_NOWHERE || crawl_state.repeat_cmd == CMD_SEARCH) @@ -472,7 +472,7 @@ void game_state::dump(FILE* file) if (cmd_repeat_count > 0 || cmd_repeat_goal > 0) { - fprintf(file, "Doing command repitition:" EOL); + fprintf(file, "Doing command repetition:" EOL); fprintf(file, "cmd_repeat_start:%d, cmd_repeat_count: %d, " "cmd_repeat_goal:%d" EOL "prev_cmd_repeat_goal: %d" EOL, |