summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/beam.cc
diff options
context:
space:
mode:
authorzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-28 03:32:17 +0000
committerzelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573>2008-12-28 03:32:17 +0000
commitd04224e3fc2b5271620775742cf316da09513f77 (patch)
treee953c0e48aad75a3e3b8be16e5ceea3e26b5bd3e /crawl-ref/source/beam.cc
parent56cb1b52027f736f1d3ec32b08efb52552befaf3 (diff)
downloadcrawl-ref-d04224e3fc2b5271620775742cf316da09513f77.tar.gz
crawl-ref-d04224e3fc2b5271620775742cf316da09513f77.zip
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
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r--crawl-ref/source/beam.cc5
1 files changed, 4 insertions, 1 deletions
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