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

Function get_walk_group

plugins/burrow.cpp:481–496  ·  view source on GitHub ↗

ramp tops inherit walkability group of the tile below

Source from the content-addressed store, hash-verified

479
480// ramp tops inherit walkability group of the tile below
481static uint16_t get_walk_group(const df::coord & pos) {
482 df::tile_designation *des = Maps::getTileDesignation(pos);
483 if (!des || des->bits.hidden)
484 return 0;
485 uint16_t walk = Maps::getWalkableGroup(pos);
486 if (walk)
487 return walk;
488 if (auto tt = Maps::getTileType(pos)) {
489 if (tileShape(*tt) == df::tiletype_shape::RAMP_TOP) {
490 df::coord pos_below(pos);
491 --pos_below.z;
492 walk = Maps::getWalkableGroup(pos_below);
493 }
494 }
495 return walk;
496}
497
498static bool is_tree(const df::tiletype *tt) {
499 return tileMaterial(*tt) == tiletype_material::TREE;

Callers 1

flood_fillFunction · 0.85

Calls 3

getTileDesignationFunction · 0.85
getTileTypeFunction · 0.85
tileShapeFunction · 0.85

Tested by

no test coverage detected