From d04224e3fc2b5271620775742cf316da09513f77 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sun, 28 Dec 2008 03:32:17 +0000 Subject: Oops, don't automatically set aimed_at_feet, since the caller might be doing weird stuff with source and target. Make setup_mons_cast() deal with it for monster spells which the monster aims at itself. Force range to 0 when source == target. In mons_cast() assert that targeted spells have an in-bounds target and that harmful spells are only aimed at the caster when the caster is confused. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@8000 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'crawl-ref/source/beam.cc') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 2f8fec57ba..05bac81884 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1463,6 +1463,9 @@ void bolt::initialize_fire() source = ray.pos(); } + if (target == source) + range = 0; + if (range == -1) { #if DEBUG @@ -1494,6 +1497,7 @@ void bolt::initialize_fire() ASSERT(flavour > BEAM_NONE && flavour < BEAM_FIRST_PSEUDO); ASSERT(!drop_item || item && is_valid_item(*item)); ASSERT(range >= 0); + ASSERT(!aimed_at_feet || source == target); real_flavour = flavour; @@ -1909,7 +1913,6 @@ void bolt::do_fire() { auto_hit = true; aimed_at_spot = true; - aimed_at_feet = true; use_target_as_pos = true; } else -- cgit v1.2.3-54-g00ecf