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.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc
index 007f5dfb3f..b64cf0de77 100644
--- a/crawl-ref/source/monstuff.cc
+++ b/crawl-ref/source/monstuff.cc
@@ -4602,9 +4602,9 @@ static void _handle_movement(monsters *monster)
// Bounds check: don't let fleeing monsters try to run off the map.
const coord_def s = monster->target + mmov;
- if (s.x < 0 || s.x >= GXM)
+ if (!map_bounds_x(s.x))
mmov.x = 0;
- if (s.y < 0 || s.y >= GYM)
+ if (!map_bounds_y(s.y))
mmov.y = 0;
// Now quit if we can't move.
@@ -7147,9 +7147,9 @@ static void _handle_monster_move(int i, monsters *monster)
// Bounds check: don't let confused monsters try to run
// off the map.
const coord_def s = monster->pos() + mmov;
- if (s.x < 0 || s.x >= GXM)
+ if (!map_bounds_x(s.x))
mmov.x = 0;
- if (s.y < 0 || s.y >= GYM)
+ if (!map_bounds_y(s.y))
mmov.y = 0;
if (!monster->can_pass_through(monster->pos() + mmov))