summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-09 11:55:01 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-01-09 11:55:01 +0000
commita4a77c91709bf945617d9c59c1936d00d5b9be46 (patch)
tree6586157109973f6141147695c6a2cdee066b2aaf /crawl-ref
parente6d7e4233b4fec8a0cdb9b7d0d1635279454d707 (diff)
downloadcrawl-ref-a4a77c91709bf945617d9c59c1936d00d5b9be46.tar.gz
crawl-ref-a4a77c91709bf945617d9c59c1936d00d5b9be46.zip
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
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/beam.cc9
-rw-r--r--crawl-ref/source/mstuff2.cc1
-rw-r--r--crawl-ref/source/view.cc5
3 files changed, 10 insertions, 5 deletions
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);