diff options
author | Robert Vollmert <rvollmert@gmx.net> | 2009-11-21 10:56:06 +0100 |
---|---|---|
committer | Robert Vollmert <rvollmert@gmx.net> | 2009-11-21 11:20:30 +0100 |
commit | 201207baf25adbba05f334d80037d186281bccdf (patch) | |
tree | 32d2feba20f08aeef79221e6bd0a1e5128d270ed /crawl-ref/source/areas.cc | |
parent | 7a5fc61d8ed68ea39388f9d779fb9bd0efedbf93 (diff) | |
download | crawl-ref-201207baf25adbba05f334d80037d186281bccdf.tar.gz crawl-ref-201207baf25adbba05f334d80037d186281bccdf.zip |
Simplify.
Diffstat (limited to 'crawl-ref/source/areas.cc')
-rw-r--r-- | crawl-ref/source/areas.cc | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/crawl-ref/source/areas.cc b/crawl-ref/source/areas.cc index 538735703e..31be349598 100644 --- a/crawl-ref/source/areas.cc +++ b/crawl-ref/source/areas.cc @@ -27,25 +27,6 @@ #include "travel.h" #include "viewgeom.h" -// Is where inside a circle within LOS, with the given radius, -// centered on the player's position? If so, return the distance to it. -// Otherwise, return -1. -static int _inside_circle(const coord_def& where, int radius) -{ - if (!in_bounds(where)) - return -1; - - const coord_def ep = grid2view(where); - if (!in_los_bounds(ep)) - return -1; - - const int dist = distance(where, you.pos()); - if (dist > radius*radius) - return -1; - - return (dist); -} - static void _remove_sanctuary_property(const coord_def& where) { env.pgrid(where) &= ~(FPROP_SANCTUARY_1 | FPROP_SANCTUARY_2); @@ -142,12 +123,9 @@ void create_sanctuary(const coord_def& center, int time) for (radius_iterator ri(center, radius, C_POINTY); ri; ++ri) { - const int dist = _inside_circle(*ri, radius); - - if (dist == -1) - continue; - const coord_def pos = *ri; + const int dist = distance(center, pos); + if (testbits(env.pgrid(pos), FPROP_BLOODY) && you.see_cell(pos)) blood_count++; |