From 5b7701dc9d19fdad4de1a64b41995d65c03b7df6 Mon Sep 17 00:00:00 2001 From: Adam Borowski Date: Mon, 21 Dec 2009 01:43:19 +0100 Subject: Short-circuit behaviour_event(), projectiles are not supposed to behave. --- crawl-ref/source/mon-behv.cc | 2 ++ crawl-ref/source/mon-project.cc | 9 +++++---- 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 { -- cgit v1.2.3-54-g00ecf