From 1da0974e29bcfdc791014fff8a2c4ad319fe26a2 Mon Sep 17 00:00:00 2001 From: haranp Date: Tue, 24 Feb 2009 19:30:59 +0000 Subject: When a monster wakes up, give it a foe *before* it shouts, not after. Fixes [2634507]. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9197 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/monstuff.cc | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'crawl-ref/source/monstuff.cc') diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index 90efb07d3b..25bff52498 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -2669,10 +2669,6 @@ void behaviour_event(monsters *mon, mon_event_type event, int src, break; } - // If it woke up, it might shout. - if (was_sleeping && !mons_is_sleeping(mon) && allow_shout) - handle_monster_shouts(mon); - if (setTarget) { if (src == MHITYOU) @@ -2694,6 +2690,10 @@ void behaviour_event(monsters *mon, mon_event_type event, int src, _handle_behaviour(mon); ASSERT(in_bounds(mon->target) || mon->target.origin()); + // If it woke up, it might shout. + if (was_sleeping && !mons_is_sleeping(mon) && allow_shout) + handle_monster_shouts(mon); + const bool wasLurking = (old_behaviour == BEH_LURK && !mons_is_lurking(mon)); const bool isPacified = mons_is_pacified(mon); @@ -3833,7 +3833,6 @@ static void _handle_behaviour(monsters *mon) const dungeon_feature_type can_move = (mons_amphibious(mon)) ? DNGN_DEEP_WATER : DNGN_SHALLOW_WATER; - // Validate current target exists. if (mon->foe != MHITNOT && mon->foe != MHITYOU) { -- cgit v1.2.3-54-g00ecf