From ebf5a248635cf60c77083a6f6e2c13a6ac765cda Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Thu, 15 Oct 2009 11:31:01 +0200 Subject: Remove fallback calculation from find_ray. There is now a separate fallback_ray() that needs to be called explicitly. I've manually converted uses of find_ray with allow_fallback == true. find_ray with allow_fallback set always returned true, yet there were a number of places that used the return value, in particular in directn.cc. I'll check these later. --- crawl-ref/source/beam.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'crawl-ref/source/beam.cc') diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index de692872c5..e87cfbd906 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -1591,7 +1591,10 @@ void bolt::apply_beam_conducts() void bolt::choose_ray() { if (!chose_ray || reflections > 0) - find_ray(source, target, true, ray, 0, true); + { + if (!find_ray(source, target, ray, 0, true)) + fallback_ray(source, target, ray); + } } // Draw the bolt at p if needed. @@ -2844,7 +2847,7 @@ bool check_line_of_sight(const coord_def& source, const coord_def& target) // Note that we are guaranteed to be within the player LOS range, // so fallback is unnecessary. ray_def ray; - return find_ray(source, target, false, ray); + return find_ray(source, target, ray); } // When a mimic is hit by a ranged attack, it teleports away (the slow -- cgit v1.2.3-54-g00ecf