summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/ouch.cc
diff options
context:
space:
mode:
authorMatthew Cline <zelgadis@sourceforge.net>2009-11-24 01:00:14 -0800
committerMatthew Cline <zelgadis@sourceforge.net>2009-11-24 03:19:36 -0800
commit2805b3beebfd7913794a412cc5a2d68042051257 (patch)
treedb1ae39d931770bcee89ed11f1f4c9d25a634451 /crawl-ref/source/ouch.cc
parent6ca662b8cced71f9eb5938519540cd9aa2207c09 (diff)
downloadcrawl-ref-2805b3beebfd7913794a412cc5a2d68042051257.tar.gz
crawl-ref-2805b3beebfd7913794a412cc5a2d68042051257.zip
you.never_die (player::never_die)
If the macros DEBUG or WIZARD are defined, then class player will have the member never_die, which if set to true makes any deadly calls to ouch() return without the game ending.
Diffstat (limited to 'crawl-ref/source/ouch.cc')
-rw-r--r--crawl-ref/source/ouch.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index da61e3fc34..4698c7f506 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -1137,6 +1137,15 @@ void ouch(int dam, int death_source, kill_method_type death_type,
death_type = KILLED_BY_XOM;
}
+#if WIZARD || DEBUG
+ if (you.never_die)
+ {
+ mpr("you.never_die set to true, avoiding death",
+ MSGCH_DIAGNOSTICS);
+ return;
+ }
+#endif
+
// Construct scorefile entry.
scorefile_entry se(dam, death_source, death_type, aux);