summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-20 17:31:40 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-20 17:31:40 +0000
commit0b103119bb91d60929ddd2a016395698778151d7 (patch)
tree7a023d5d41725e521b5f315c5a3f571181665b75 /crawl-ref/source/monstuff.cc
parentba63a568575136615218a017816e45bea083ec50 (diff)
downloadcrawl-ref-0b103119bb91d60929ddd2a016395698778151d7.tar.gz
crawl-ref-0b103119bb91d60929ddd2a016395698778151d7.zip
Put in *proper* sanity fixes for forcibly converting orcish followers,
and for Elyvilon's healing monsters (thanks Darshan!). Note that these are needed for some other menv[] accesses as well. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3754 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 1892c6dab7..b0bf368639 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -476,13 +476,15 @@ static bool ely_heals_monster(monsters *monster, killer_type killer, int i)
{
return (false);
}
-
- if (MON_KILL(killer))
+
+ if (MON_KILL(killer)
+ && i != ANON_FRIENDLY_MONSTER
+ && i >= 0 && i < MAX_MONSTERS)
{
monsters *mon = &menv[i];
if (!mons_friendly(mon) || !one_chance_in(3))
return (false);
-
+
if (!mons_near(monster))
return (false);
}
@@ -538,7 +540,9 @@ static bool monster_avoided_death(monsters *monster, killer_type killer, int i)
{
if (YOU_KILL(killer))
convert = true;
- else if (MON_KILL(killer) && i != -1)
+ else if (MON_KILL(killer)
+ && i != ANON_FRIENDLY_MONSTER
+ && i >= 0 && i < MAX_MONSTERS)
{
monsters *mon = &menv[i];
if (is_orcish_follower(mon) && !one_chance_in(3))