summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/monstuff.cc
diff options
context:
space:
mode:
Diffstat (limited to 'crawl-ref/source/monstuff.cc')
-rw-r--r--crawl-ref/source/monstuff.cc9
1 files changed, 2 insertions, 7 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 4534a5020d..4dffb17f14 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -2125,13 +2125,8 @@ static bool handle_special_ability(struct monsters *monster, bolt & beem)
continue;
// faking LOS by checking the neighbouring square
- int dx = targ->x - monster->x;
- if (dx)
- dx /= dx;
-
- int dy = targ->y - monster->y;
- if (dy)
- dy /= dy;
+ int dx = sgn(targ->x - monster->x);
+ int dy = sgn(targ->y - monster->y);
const int tx = monster->x + dx;
const int ty = monster->y + dy;