summaryrefslogtreecommitdiffstats
path: root/crawl-ref
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
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')
-rw-r--r--crawl-ref/source/monplace.cc9
-rw-r--r--crawl-ref/source/monstuff.cc7
-rw-r--r--crawl-ref/source/view.cc2
3 files changed, 15 insertions, 3 deletions
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 985dab7cc0..85e000dc33 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -2116,11 +2116,14 @@ int mons_place(mgen_data mg)
if (creation->type == MONS_RAKSHASA_FAKE && !one_chance_in(3))
creation->add_ench(ENCH_INVIS);
- if (!(mg.flags & MG_FORCE_BEH))
+ if (!(mg.flags & MG_FORCE_BEH) && !crawl_state.arena)
player_angers_monster(creation);
- // Make summoned being aware of player's presence.
- behaviour_event(creation, ME_ALERT, MHITYOU);
+ if (crawl_state.arena)
+ behaviour_event(creation, ME_EVAL);
+ else
+ // Make summoned being aware of player's presence.
+ behaviour_event(creation, ME_ALERT, MHITYOU);
}
return (mid);
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)
diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc
index ce20205bca..bf46e7af64 100644
--- a/crawl-ref/source/view.cc
+++ b/crawl-ref/source/view.cc
@@ -1213,6 +1213,8 @@ inline static bool _update_monster_grid(const monsters *monster)
void monster_grid(bool do_updates)
{
+ do_updates = do_updates && !crawl_state.arena;
+
monsters *monster = NULL;
for (int s = 0; s < MAX_MONSTERS; s++)