From 77deedc3637e918201878fa4e1424d7287ec3af2 Mon Sep 17 00:00:00 2001 From: Robert Vollmert Date: Thu, 15 Oct 2009 10:18:33 +0200 Subject: Assert invariant in find_ray. --- crawl-ref/source/los.cc | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'crawl-ref/source') diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc index 586b96b7ad..352230000f 100644 --- a/crawl-ref/source/los.cc +++ b/crawl-ref/source/los.cc @@ -639,6 +639,12 @@ bool _find_ray_se(const coord_def& target, bool allow_fallback, const double ray_slope_diff = find_shortest ? fabs(_slope_factor(lray) - want_slope) : 0.0; + if (!blocked && find_shortest) + { + // any unaliased ray should have the same length + ASSERT(real_length == target.rdist()); + } + if (blocked || (find_shortest && !_superior_ray(shortest, imbalance, real_length, cimbalance, -- cgit v1.2.3-54-g00ecf