… | |
… | |
352 | |
352 | |
353 | // due to historical glitches, the mapinfo index and tile index differs |
353 | // due to historical glitches, the mapinfo index and tile index differs |
354 | static unsigned char dirmap [] = { TILE_NORTH, TILE_EAST, TILE_SOUTH, TILE_WEST, TILE_UP, TILE_DOWN }; |
354 | static unsigned char dirmap [] = { TILE_NORTH, TILE_EAST, TILE_SOUTH, TILE_WEST, TILE_UP, TILE_DOWN }; |
355 | |
355 | |
356 | // maybe we should only allow the four flat directions |
356 | // maybe we should only allow the four flat directions |
357 | if (IN_RANGE_EXC (dir, 0, array_length (dirmap))) |
357 | if (IN_RANGE_EXC (dir, 0, ecb_array_length (dirmap))) |
358 | { |
358 | { |
359 | dir = dirmap [dir]; |
359 | dir = dirmap [dir]; |
360 | |
360 | |
361 | if (!map->tile_path [dir]) |
361 | if (!map->tile_path [dir]) |
362 | map = 0; |
362 | map = 0; |