if the outside tile flag is set or it's light and it's a tree or there are just outside or light tree tiles above it
| 507 | // or it's light and it's a tree |
| 508 | // or there are just outside or light tree tiles above it |
| 509 | static bool is_outside(const df::coord & pos, const df::tile_designation *des) { |
| 510 | if (!des) |
| 511 | return false; |
| 512 | if (des->bits.outside) |
| 513 | return true; |
| 514 | if (!des->bits.light) |
| 515 | return false; |
| 516 | |
| 517 | df::coord pos_above = pos + df::coord(0, 0, 1); |
| 518 | df::tile_designation *des_above = Maps::getTileDesignation(pos_above); |
| 519 | df::tiletype *tt_above = Maps::getTileType(pos_above); |
| 520 | if (!des_above || !tt_above || (!is_tree(tt_above) && !LowPassable(*tt_above))) |
| 521 | return false; |
| 522 | |
| 523 | return is_outside(pos_above, des_above); |
| 524 | } |
| 525 | |
| 526 | static void flood_fill(lua_State *L, bool enable) { |
| 527 | df::coord start_pos; |
no test coverage detected