MCPcopy Create free account
hub / github.com/DFHack/dfhack / is_outside

Function is_outside

plugins/burrow.cpp:509–524  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

507// or it's light and it's a tree
508// or there are just outside or light tree tiles above it
509static 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
526static void flood_fill(lua_State *L, bool enable) {
527 df::coord start_pos;

Callers 1

flood_fillFunction · 0.85

Calls 4

getTileDesignationFunction · 0.85
getTileTypeFunction · 0.85
is_treeFunction · 0.85
LowPassableFunction · 0.85

Tested by

no test coverage detected