diff options
author | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-14 09:16:40 +0000 |
---|---|---|
committer | zelgadis <zelgadis@c06c8d41-db1a-0410-9941-cceddc491573> | 2009-06-14 09:16:40 +0000 |
commit | b5e038ca7cc358785ad7ca0a9160bffd8a1c2df7 (patch) | |
tree | 2d4b8760bffa31285092e7bda3d4725a7de4feca /crawl-ref/source/beam.cc | |
parent | cb8b2c484b3ff8f2a93b435d5d2fdda3c0f4bb12 (diff) | |
download | crawl-ref-b5e038ca7cc358785ad7ca0a9160bffd8a1c2df7.tar.gz crawl-ref-b5e038ca7cc358785ad7ca0a9160bffd8a1c2df7.zip |
Fix bug 2805988: firing a beam at an empty square which then continues
on to hit a wall was giving a "blocked line of fire" warning message.
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/branches/stone_soup-0.5@9975 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/beam.cc')
-rw-r--r-- | crawl-ref/source/beam.cc | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index fb9d6f006a..31511af214 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1792,11 +1792,11 @@ void bolt::hit_wall() const dungeon_feature_type feat = grd(pos()); ASSERT( grid_is_solid(feat) ); - if (is_tracer && YOU_KILL(thrower) && in_bounds(target) + if (is_tracer && YOU_KILL(thrower) && in_bounds(target) && !passed_target && pos() != target && pos() != source && foe_info.count == 0 && flavour != BEAM_DIGGING && flavour <= BEAM_LAST_REAL - && !affects_nothing && bounces == 0 && reflections == 0 - && see_grid(target) && !grid_is_solid(grd(target))) + && bounces == 0 && reflections == 0 && see_grid(target) + && !grid_is_solid(grd(target))) { // Okay, with all those tests passed, this is probably an instance // of the player manually targetting something whose line of fire @@ -2021,8 +2021,12 @@ void bolt::do_fire() if (beam_cancelled) return; - if (stop_at_target() && pos() == target) - break; + if (pos() == target) + { + passed_target = true; + if (stop_at_target()) + break; + } ASSERT(!grid_is_solid(grd(pos())) || (is_tracer && affects_wall(grd(pos())))); @@ -5514,10 +5518,11 @@ bolt::bolt() : range(-2), type('*'), range_funcs(), damage_funcs(), hit_funcs(), obvious_effect(false), seen(false), path_taken(), range_used(0), is_tracer(false), aimed_at_feet(false), msg_generated(false), - in_explosion_phase(false), smart_monster(false), - can_see_invis(false), attitude(ATT_HOSTILE), foe_ratio(0), - chose_ray(false), beam_cancelled(false), dont_stop_player(false), - bounces(false), bounce_pos(), reflections(0), reflector(-1) + passed_target(false), in_explosion_phase(false), + smart_monster(false), can_see_invis(false), + attitude(ATT_HOSTILE), foe_ratio(0), chose_ray(false), + beam_cancelled(false), dont_stop_player(false), bounces(false), + bounce_pos(), reflections(0), reflector(-1) { } |