summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/effects.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-17 05:46:58 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-17 05:46:58 +0000
commit39993ad45e6330875f2cc53faaa60004ca8ee4e1 (patch)
treee73843ace1968cc0efe1d288ec2e4da1fd0bfb29 /crawl-ref/source/effects.cc
parentaab81bbb1af6a92ceab0496b574e879a6da80461 (diff)
downloadcrawl-ref-39993ad45e6330875f2cc53faaa60004ca8ee4e1.tar.gz
crawl-ref-39993ad45e6330875f2cc53faaa60004ca8ee4e1.zip
Fix torment_player() crashing when Xom was the source of the torment.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8494 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/effects.cc')
-rw-r--r--crawl-ref/source/effects.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index b51f8410d7..6ae8982826 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -183,8 +183,13 @@ int torment_player(int pow, int caster)
const char *aux = "torment";
- if (caster < 0)
+ kill_method_type type = KILLED_BY_MONSTER;
+ if (invalid_monster_index(caster))
{
+ type = KILLED_BY_SOMETHING;
+ if (crawl_state.is_god_acting())
+ type = KILLED_BY_DIVINE_WRATH;
+
switch (caster)
{
case TORMENT_CARDS:
@@ -203,14 +208,13 @@ int torment_player(int pow, int caster)
break;
case TORMENT_XOM:
- aux = "Xom's torment";
+ type = KILLED_BY_XOM;
+ aux = "Xom's torment";
break;
}
}
- ouch(hploss, caster, (caster != TORMENT_GENERIC) ? KILLED_BY_MONSTER
- : KILLED_BY_SOMETHING,
- aux);
+ ouch(hploss, caster, type, aux);
return 1;
}