summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-01 04:05:20 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2007-10-01 04:05:20 +0000
commit98100e7b225f2f0801488e4a822d9dbc340c9d28 (patch)
treebebfcf4225986813cb2c86927ab10da239f016ab /crawl-ref/source/ouch.cc
parentfa99383f22dc88727a46e209d9d080b460262782 (diff)
downloadcrawl-ref-98100e7b225f2f0801488e4a822d9dbc340c9d28.tar.gz
crawl-ref-98100e7b225f2f0801488e4a822d9dbc340c9d28.zip
Fix wizard mode cheating-death from losing experience or levels when
level 1, so you won't end up as a level 0 character with 0 HP. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@2272 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc8
1 files changed, 8 insertions, 0 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index 636a9234dc..258309c533 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -589,7 +589,11 @@ void lose_level()
// because you.experience is unsigned long, if it's going to be -ve
// must die straightaway.
if (you.experience_level == 1)
+ {
ouch( -9999, 0, KILLED_BY_DRAINING );
+ // Return in case death was canceled via wizard mode
+ return;
+ }
you.experience = exp_needed( you.experience_level + 1 ) - 1;
you.experience_level--;
@@ -636,7 +640,11 @@ void drain_exp(void)
}
if (you.experience == 0)
+ {
ouch(-9999, 0, KILLED_BY_DRAINING);
+ // Return in case death was escaped via wizard mode;
+ return;
+ }
if (you.experience_level == 1)
{