summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Vollmert <rvollmert@gmx.net>2009-11-08 20:04:00 +0100
committerRobert Vollmert <rvollmert@gmx.net>2009-11-08 20:05:47 +0100
commit44191bee0ba18382a7c38cac428375d480d15af8 (patch)
tree8b33568e5f86b6f0994e05e0c0f8d74ae45ba907
parent302c451890468d0b0b9cafd83094fe38669be0d4 (diff)
downloadcrawl-ref-44191bee0ba18382a7c38cac428375d480d15af8.tar.gz
crawl-ref-44191bee0ba18382a7c38cac428375d480d15af8.zip
Fix halo_contains always returning true for the actor.
There was a check of distance <= radius squared, which always passed for radius 0.
-rw-r--r--crawl-ref/source/halo.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/crawl-ref/source/halo.cc b/crawl-ref/source/halo.cc
index a2ddb588d6..f78b3e30bd 100644
--- a/crawl-ref/source/halo.cc
+++ b/crawl-ref/source/halo.cc
@@ -16,7 +16,7 @@ bool actor::haloed() const
bool actor::halo_contains(const coord_def &c) const
{
int r = halo_radius();
- return ((c - pos()).abs() <= r * r && see_cell(c));
+ return (r > 0 && (c - pos()).abs() <= r * r && see_cell(c));
}
int player::halo_radius() const