From df940b3d40577cd05d71ebe7613f0dec1f115e91 Mon Sep 17 00:00:00 2001 From: Matthew Cline Date: Sun, 15 Nov 2009 03:14:10 -0800 Subject: Make test-spawners work properly again. --- crawl-ref/source/mon-behv.cc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'crawl-ref/source/mon-behv.cc') diff --git a/crawl-ref/source/mon-behv.cc b/crawl-ref/source/mon-behv.cc index c7a4e805b7..9c241fac9d 100644 --- a/crawl-ref/source/mon-behv.cc +++ b/crawl-ref/source/mon-behv.cc @@ -1027,6 +1027,23 @@ static void _guess_invis_foe_pos(monsters *mon, bool strict = true) //--------------------------------------------------------------- void handle_behaviour(monsters *mon) { + // Test spawners should always be BEH_SEEK against a foe, since + // their only purpose is to spew out monsters for testing + // purposes. + if (mon->type == MONS_TEST_SPAWNER) + { + for (monster_iterator mi; mi; ++mi) + { + if (mon->attitude != mi->attitude) + { + mon->foe = mi->mindex(); + mon->target = mi->pos(); + mon->behaviour = BEH_SEEK; + return; + } + } + } + bool changed = true; bool isFriendly = mon->friendly(); bool isNeutral = mon->neutral(); -- cgit v1.2.3-54-g00ecf