summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2009-12-21 01:43:19 +0100
committerAdam Borowski <kilobyte@angband.pl>2009-12-21 01:44:48 +0100
commit5b7701dc9d19fdad4de1a64b41995d65c03b7df6 (patch)
treedb6df3c4b84e934ca36cbb8aef7d2390acea2b67 /crawl-ref
parentc546c371c46b95a99afd87300a28f39318fa6cb3 (diff)
downloadcrawl-ref-5b7701dc9d19fdad4de1a64b41995d65c03b7df6.tar.gz
crawl-ref-5b7701dc9d19fdad4de1a64b41995d65c03b7df6.zip
Short-circuit behaviour_event(), projectiles are not supposed to behave.
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/mon-behv.cc2
-rw-r--r--crawl-ref/source/mon-project.cc9
2 files changed, 7 insertions, 4 deletions
diff --git a/crawl-ref/source/mon-behv.cc b/crawl-ref/source/mon-behv.cc
index aea54df3e6..98a1f3e853 100644
--- a/crawl-ref/source/mon-behv.cc
+++ b/crawl-ref/source/mon-behv.cc
@@ -680,6 +680,8 @@ void behaviour_event(monsters *mon, mon_event_type event, int src,
ASSERT(src >= 0 && src <= MHITYOU);
ASSERT(!crawl_state.arena || src != MHITYOU);
ASSERT(in_bounds(src_pos) || src_pos.origin());
+ if (mons_is_projectile(mon->type))
+ return; // projectiles have no AI
const beh_type old_behaviour = mon->behaviour;
diff --git a/crawl-ref/source/mon-project.cc b/crawl-ref/source/mon-project.cc
index d6eced6085..ffd0eb2c00 100644
--- a/crawl-ref/source/mon-project.cc
+++ b/crawl-ref/source/mon-project.cc
@@ -30,6 +30,8 @@
bool cast_iood(actor *caster, int pow, bolt *beam)
{
int mtarg = mgrd(beam->target);
+ if (beam->target == you.pos())
+ mtarg = MHITYOU;
int mind = mons_place(mgen_data(MONS_ORB_OF_DESTRUCTION,
(caster->atype() == ACT_PLAYER) ? BEH_FRIENDLY :
@@ -38,8 +40,7 @@ bool cast_iood(actor *caster, int pow, bolt *beam)
0,
SPELL_IOOD,
coord_def(-1, -1),
- (mtarg != NON_MONSTER) ? mtarg :
- (you.pos() == beam->target) ? MHITYOU : MHITNOT,
+ mtarg,
0,
GOD_NO_GOD));
if (mind == -1)
@@ -124,9 +125,9 @@ bool iood_act(monsters &mon, bool no_trail)
float vx = mon.props["iood_vx"];
float vy = mon.props["iood_vy"];
- dprf("iood_act: pos (%d,%d) rpos (%f,%f) v (%f,%f)",
+ dprf("iood_act: pos=(%d,%d) rpos=(%f,%f) v=(%f,%f) foe=%d",
mon.pos().x, mon.pos().y,
- x, y, vx, vy);
+ x, y, vx, vy, mon.foe);
if (!vx && !vy) // not initialized
{