… | |
… | |
21 | * |
21 | * |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
22 | * The authors can be reached via e-mail to <support@deliantra.net> |
23 | */ |
23 | */ |
24 | |
24 | |
25 | #include <global.h> |
25 | #include <global.h> |
|
|
26 | #include <util.h> |
26 | #include <random_map.h> |
27 | #include <random_map.h> |
27 | #include <rproto.h> |
28 | #include <rproto.h> |
28 | |
29 | |
29 | /* Put in the walls and autojoin them. */ |
30 | /* Put in the walls and autojoin them. */ |
30 | |
31 | |
… | |
… | |
162 | for (int dy = -1; dy <= 1; ++dy) |
163 | for (int dy = -1; dy <= 1; ++dy) |
163 | { |
164 | { |
164 | int x = i + dx; |
165 | int x = i + dx; |
165 | int y = j + dy; |
166 | int y = j + dy; |
166 | |
167 | |
167 | if (x >= 0 && x < maze.w |
168 | if (IN_RANGE_EXC (x, 0, maze.w) |
168 | && y >= 0 && y < maze.h |
169 | && IN_RANGE_EXC (y, 0, maze.h) |
169 | && maze [x][y] != '#') |
170 | && maze [x][y] != '#') |
170 | return true; |
171 | return true; |
171 | } |
172 | } |
172 | |
173 | |
173 | return false; |
174 | return false; |