From 25823b36905a84d92f9299ba7f9f0c713141c8fb Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Mon, 18 Feb 2013 19:20:35 -0800 Subject: Strictify map cells Also fix a small but major bug in map_randfreecell. --- src/map/magic-expr.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'src/map/magic-expr.cpp') diff --git a/src/map/magic-expr.cpp b/src/map/magic-expr.cpp index ea853a1..a366cc0 100644 --- a/src/map/magic-expr.cpp +++ b/src/map/magic-expr.cpp @@ -14,11 +14,6 @@ #include "../poison.hpp" -bool map_is_solid(int m, int x, int y) -{ - return map_getcell(m, x, y) == 1; -} - static void free_area(area_t *area) { @@ -850,7 +845,9 @@ int fun_awayfrom(env_t *, int, val_t *result, val_t *args) int dx = dirx[ARGDIR(1)]; int dy = diry[ARGDIR(1)]; int distance = ARGINT(2); - while (distance-- && !map_is_solid(loc->m, loc->x + dx, loc->y + dy)) + while (distance-- + && !bool(read_gat(loc->m, loc->x + dx, loc->y + dy) + & MapCell::UNWALKABLE)) { loc->x += dx; loc->y += dy; -- cgit v1.2.3-60-g2f50