From bf43967bc6de08383813ea532bf75c2d441d0e89 Mon Sep 17 00:00:00 2001 From: zelgadis Date: Sun, 14 Jun 2009 11:03:40 +0000 Subject: Merge r9975 from 0.5 branch: fix spurious line-of-fire warning bug. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9977 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/beam.cc | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'crawl-ref/source/beam.cc') 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) { } -- cgit v1.2.3-54-g00ecf