summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-01 22:36:23 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-01 22:36:23 +0000
commitf9d00d00e2bd56d0f454ebea332e0617dcc4caa0 (patch)
treeb2c61355ccfc905e1e5fec07537976a9ce0071ed /crawl-ref/source/monstuff.cc
parente9ad68074279a85382ad98d33f147234f9a79499 (diff)
downloadcrawl-ref-f9d00d00e2bd56d0f454ebea332e0617dcc4caa0.tar.gz
crawl-ref-f9d00d00e2bd56d0f454ebea332e0617dcc4caa0.zip
Some assertions for behaviour_event().
In mons_place(), don't alert summons to the player's presence during arena mode. In monster_grid(), don't do check_awaken() on monsters during arena mode. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8093 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 9c79bdccc0..b0ca5be470 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -2291,6 +2291,10 @@ static bool _wounded_damaged(int monster_type)
void behaviour_event(monsters *mon, int event, int src,
coord_def src_pos)
{
+ ASSERT(src >= 0 && src <= MHITYOU);
+ ASSERT(!crawl_state.arena || src != MHITYOU);
+ ASSERT(in_bounds(src_pos) || src_pos == coord_def());
+
beh_type old_behaviour = mon->behaviour;
bool isSmart = (mons_intel(mon) > I_ANIMAL);
@@ -2488,6 +2492,9 @@ void behaviour_event(monsters *mon, int event, int src,
// unsubmerge.
mon->behaviour = BEH_LURK;
}
+
+ ASSERT(!crawl_state.arena
+ || mon->foe != MHITYOU && mon->target != you.pos());
}
static bool _choose_random_patrol_target_grid(monsters *mon)