… | |
… | |
345 | while (*buf && map && max_distance) |
345 | while (*buf && map && max_distance) |
346 | { |
346 | { |
347 | int dir = *buf++ - '1'; |
347 | int dir = *buf++ - '1'; |
348 | |
348 | |
349 | // maybe we should only allow the four flat directions |
349 | // maybe we should only allow the four flat directions |
350 | if (dir >= 0 && dir < TILE_NUM) |
350 | if (dir >= 0 && dir < array_length (map->tile_path)) |
351 | { |
351 | { |
352 | if (!map->tile_path [dir]) |
352 | if (!map->tile_path [dir]) |
353 | map = 0; |
353 | map = 0; |
354 | else if (map->tile_available (dir, false)) |
354 | else if (map->tile_available (dir, false)) |
355 | { |
355 | { |