From a4a77c91709bf945617d9c59c1936d00d5b9be46 Mon Sep 17 00:00:00 2001 From: haranp Date: Fri, 9 Jan 2009 11:55:01 +0000 Subject: Fix [2484866]: affects_nothing was being ignored. Also cleaned up returning weapons somewhat; they will no longer overshoot you and then try to hit you on the way back. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8355 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 9 ++++++--- crawl-ref/source/mstuff2.cc | 1 + crawl-ref/source/view.cc | 5 +++-- 3 files changed, 10 insertions(+), 5 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 507c6441d0..8356b3665f 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1957,7 +1957,8 @@ void bolt::do_fire() while (in_bounds(pos())) { - affect_cell(); + if (!affects_nothing) + affect_cell(); range_used++; if (range_used >= range) @@ -2013,10 +2014,11 @@ void bolt::do_fire() } // The beam has terminated. - affect_endpoint(); + if (!affects_nothing) + affect_endpoint(); // Tracers need nothing further. - if (is_tracer) + if (is_tracer || affects_nothing) return; // Canned msg for enchantments that affected no-one, but only if the @@ -5485,6 +5487,7 @@ void bolt::setup_retrace() std::swap(source, target); affects_nothing = true; aimed_at_spot = true; + range_used = 0; } void bolt::set_agent(actor *actor) diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc index 150720696e..0900e4946f 100644 --- a/crawl-ref/source/mstuff2.cc +++ b/crawl-ref/source/mstuff2.cc @@ -1194,6 +1194,7 @@ bool mons_throw(struct monsters *monster, struct bolt &pbolt, int hand_used) pbolt.thrower = KILL_MON_MISSILE; pbolt.item = &item; pbolt.aux_source.clear(); + pbolt.aimed_at_spot = returning; const launch_retval projected = is_launched(monster, monster->mslot_item(MSLOT_WEAPON), diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index 40d8f5ca40..143dffd0d1 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -1243,8 +1243,9 @@ void monster_grid(bool do_updates) // If this mprf triggers for you, please note any special // circumstances so we can track down where this is coming // from. - mprf(MSGCH_DIAGNOSTICS, "monster (%d) at (%d, %d) was " - "improperly placed. Updating mgrd.", s, + mprf(MSGCH_ERROR, "monster %s (%d) at (%d, %d) was " + "improperly placed. Updating mgrd.", + monster->name(DESC_PLAIN, true).c_str(), s, monster->pos().x, monster->pos().y); #endif ASSERT(mgrd(monster->pos()) == NON_MONSTER); -- cgit v1.2.3-54-g00ecf