diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-05-29 04:44:23 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-05-29 04:44:23 +0000 |
commit | 0bdad6413abe036f2e70c271f465a2da181b4116 (patch) | |
tree | 0210400ed3f49295bc04fa679e90b7faf8b76483 /crawl-ref/source/beam.cc | |
parent | f9bb873c8b6192688281a1d738c46d19352c8d51 (diff) | |
download | crawl-ref-0bdad6413abe036f2e70c271f465a2da181b4116.tar.gz crawl-ref-0bdad6413abe036f2e70c271f465a2da181b4116.zip |
Add bounds checking to line-of-fire warning code.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9846 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r-- | crawl-ref/source/beam.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 78cd63f25e..89c383336e 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1792,8 +1792,9 @@ void bolt::hit_wall() const dungeon_feature_type feat = grd(pos()); ASSERT( grid_is_solid(feat) ); - if (is_tracer && YOU_KILL(thrower) && flavour != BEAM_DIGGING - && flavour <= BEAM_LAST_REAL && pos() != target && pos() != source + if (is_tracer && YOU_KILL(thrower) && in_bounds(target) + && pos() != target && pos() != source + && flavour != BEAM_DIGGING && flavour <= BEAM_LAST_REAL && !affects_nothing && bounces == 0 && reflections == 0 && see_grid(target) && !grid_is_solid(grd(target))) { |