From 0b103119bb91d60929ddd2a016395698778151d7 Mon Sep 17 00:00:00 2001 From: dolorous Date: Thu, 20 Mar 2008 17:31:40 +0000 Subject: 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 --- crawl-ref/source/monstuff.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'crawl-ref/source/monstuff.cc') 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)) -- cgit v1.2.3-54-g00ecf