summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/los.cc
diff options
context:
space:
mode:
authorAdam Borowski <kilobyte@angband.pl>2013-12-02 02:57:18 +0100
committerAdam Borowski <kilobyte@angband.pl>2013-12-03 11:02:04 +0100
commit6cff2d6a8059d5da044b43dad8f8ed47afdf7093 (patch)
tree7c6f366c72ae4501dcf16d185ae5fbbe919eedf0 /crawl-ref/source/los.cc
parent492f6862c29f6c47e9448a91ab2615cfb2352094 (diff)
downloadcrawl-ref-6cff2d6a8059d5da044b43dad8f8ed47afdf7093.tar.gz
crawl-ref-6cff2d6a8059d5da044b43dad8f8ed47afdf7093.zip
Simplify a very convoluted way of checking c.abs().
Diffstat (limited to 'crawl-ref/source/los.cc')
-rw-r--r--crawl-ref/source/los.cc10
1 files changed, 2 insertions, 8 deletions
diff --git a/crawl-ref/source/los.cc b/crawl-ref/source/los.cc
index ce0ec37867..83dc65d89c 100644
--- a/crawl-ref/source/los.cc
+++ b/crawl-ref/source/los.cc
@@ -61,12 +61,6 @@
#include "env.h"
#include "terrain.h"
-// This determines which cells are considered out of range during
-// precalculations (only positive quadrant used).
-// For the LOS code to work correctly, any LOS shape that
-// is used needs to be contained in bds_precalc.
-static const circle_def bds_precalc = circle_def(LOS_MAX_RANGE, C_ROUND);
-
// These determine what rays are cast in the precomputation,
// and affect start-up time significantly.
// XXX: Argue that these values are sufficient.
@@ -173,7 +167,7 @@ struct los_ray : public ray_def
break;
}
c = copy.pos();
- if (!bds_precalc.contains(c))
+ if (c.abs() > LOS_RADIUS_SQ)
break;
cs.push_back(c);
ASSERT((c - old).rdist() == 1);
@@ -562,7 +556,7 @@ static bool _find_ray_se(const coord_def& target, ray_def& ray,
if (!bds.contains(target))
return false;
- ASSERT(bds_precalc.contains(target));
+ ASSERT(target.abs() <= LOS_RADIUS_SQ);
// Ensure the precalculations have been done.
raycast();