diff options
author | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-30 16:42:26 +0000 |
---|---|---|
committer | dolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573> | 2008-06-30 16:42:26 +0000 |
commit | 760579ccd2bbf5599dd615f57d04de17fdbf7735 (patch) | |
tree | 26c3c71896f68a0e17403ca2673f4fdeceb4ec0c /crawl-ref/source/ouch.cc | |
parent | 56f6f73efb98b03485b34d334ef72585e4ee41a7 (diff) | |
download | crawl-ref-760579ccd2bbf5599dd615f57d04de17fdbf7735.tar.gz crawl-ref-760579ccd2bbf5599dd615f57d04de17fdbf7735.zip |
Properly redraw the player's skill level, experience level, etc. after
losing a level due to draining.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@6253 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r-- | crawl-ref/source/ouch.cc | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc index ca34b768e0..0ba00752e0 100644 --- a/crawl-ref/source/ouch.cc +++ b/crawl-ref/source/ouch.cc @@ -68,6 +68,7 @@ #include "mon-util.h" #include "monstuff.h" #include "notes.h" +#include "output.h" #include "player.h" #include "randart.h" #include "religion.h" @@ -726,8 +727,7 @@ void drain_exp(bool announce_full) you.experience -= exp_drained; you.exp_available -= exp_drained; - if (you.exp_available < 0) - you.exp_available = 0; + you.exp_available = std::max(0, you.exp_available); #if DEBUG_DIAGNOSTICS mprf(MSGCH_DIAGNOSTICS, "You lose %ld experience points.",exp_drained); @@ -736,12 +736,15 @@ void drain_exp(bool announce_full) you.redraw_experience = true; if (you.experience < exp_needed(you.experience_level + 1)) + { lose_level(); + redraw_skill(you.your_name, player_title()); + } } } -static void xom_checks_damage(kill_method_type death_type, - int dam, int death_source) +static void _xom_checks_damage(kill_method_type death_type, + int dam, int death_source) { if (death_type == KILLED_BY_TARGETTING) { @@ -849,7 +852,7 @@ void ouch( int dam, int death_source, kill_method_type death_type, mpr( "* * * LOW HITPOINT WARNING * * *", MSGCH_DANGER ); } - xom_checks_damage(death_type, dam, death_source); + _xom_checks_damage(death_type, dam, death_source); // for note taking std::string damage_desc = ""; |