diff options
author | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-15 03:14:10 -0800 |
---|---|---|
committer | Matthew Cline <zelgadis@sourceforge.net> | 2009-11-15 03:14:10 -0800 |
commit | df940b3d40577cd05d71ebe7613f0dec1f115e91 (patch) | |
tree | 0d175299093799159a299c62ca23b5fc0239aac2 /crawl-ref/source/mon-behv.cc | |
parent | 74ff4a4b8868e7d9c7622ca7b44ac5e43ebe32f7 (diff) | |
download | crawl-ref-df940b3d40577cd05d71ebe7613f0dec1f115e91.tar.gz crawl-ref-df940b3d40577cd05d71ebe7613f0dec1f115e91.zip |
Make test-spawners work properly again.
Diffstat (limited to 'crawl-ref/source/mon-behv.cc')
-rw-r--r-- | crawl-ref/source/mon-behv.cc | 17 |
1 files changed, 17 insertions, 0 deletions
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(); |