diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2013-02-18 19:20:35 -0800 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2013-02-20 18:27:30 -0800 |
commit | 25823b36905a84d92f9299ba7f9f0c713141c8fb (patch) | |
tree | a335120de1c4618c9b41391e70bc621a4218010c /src/map/magic-expr.cpp | |
parent | a5d231b6a60a4ab868918850be24640e88843825 (diff) | |
download | tmwa-25823b36905a84d92f9299ba7f9f0c713141c8fb.tar.gz tmwa-25823b36905a84d92f9299ba7f9f0c713141c8fb.tar.bz2 tmwa-25823b36905a84d92f9299ba7f9f0c713141c8fb.tar.xz tmwa-25823b36905a84d92f9299ba7f9f0c713141c8fb.zip |
Strictify map cells
Also fix a small but major bug in map_randfreecell.
Diffstat (limited to 'src/map/magic-expr.cpp')
-rw-r--r-- | src/map/magic-expr.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
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; |