summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/player.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-19 22:56:46 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-09-19 22:56:46 +0000
commit7b52c20fd2613f4597a5b429c604369d393367ec (patch)
treeb955c5b143a0210879141bb8ad3258cf819b35fb /crawl-ref/source/player.cc
parent5e4ca0912ae656b9e2a55b95027ebc6f483a01a6 (diff)
downloadcrawl-ref-7b52c20fd2613f4597a5b429c604369d393367ec.tar.gz
crawl-ref-7b52c20fd2613f4597a5b429c604369d393367ec.zip
Input buffer needs to be flushed if the first iteration of command
repetition is canceled. Repetitions of searching and go-nowhere weren't being interrupted. Wasn't generating activity interrupts for AI_FULL_MP and AI_FULL_HP. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2150 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/player.cc')
-rw-r--r--crawl-ref/source/player.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index f7bf812bda..77b4fbe3e1 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -4200,6 +4200,8 @@ void inc_mp(int mp_gain, bool max_too)
if (mp_gain < 1)
return;
+ bool wasnt_max = (you.magic_points < you.max_magic_points);
+
you.magic_points += mp_gain;
if (max_too)
@@ -4208,6 +4210,9 @@ void inc_mp(int mp_gain, bool max_too)
if (you.magic_points > you.max_magic_points)
you.magic_points = you.max_magic_points;
+ if (wasnt_max && you.magic_points == you.max_magic_points)
+ interrupt_activity(AI_FULL_MP);
+
take_note(Note(NOTE_MP_CHANGE, you.magic_points, you.max_magic_points));
you.redraw_magic_points = 1;
@@ -4221,6 +4226,8 @@ void inc_hp(int hp_gain, bool max_too)
if (hp_gain < 1)
return;
+ bool wasnt_max = (you.hp < you.hp_max);
+
you.hp += hp_gain;
if (max_too)
@@ -4229,6 +4236,9 @@ void inc_hp(int hp_gain, bool max_too)
if (you.hp > you.hp_max)
you.hp = you.hp_max;
+ if (wasnt_max && you.hp == you.hp_max)
+ interrupt_activity(AI_FULL_HP);
+
// to avoid message spam, no information when HP increases
// take_note(Note(NOTE_HP_CHANGE, you.hp, you.hp_max));