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/source/delay.cc | |
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/source/delay.cc')
-rw-r--r-- | crawl-ref/source/delay.cc | 16 |
1 files changed, 8 insertions, 8 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, |