summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-24 19:30:59 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-24 19:30:59 +0000
commit1da0974e29bcfdc791014fff8a2c4ad319fe26a2 (patch)
tree21645418e8bdd93fc1d1343326a550736560b270 /crawl-ref/source/monstuff.cc
parent016269736049270476de15b073c5621760a23135 (diff)
downloadcrawl-ref-1da0974e29bcfdc791014fff8a2c4ad319fe26a2.tar.gz
crawl-ref-1da0974e29bcfdc791014fff8a2c4ad319fe26a2.zip
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
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc9
1 files changed, 4 insertions, 5 deletions
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)
{