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

Function adjust_smooth_wall_dir

plugins/dig-now.cpp:619–635  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

617// connects adjacent smooth walls to our new smooth wall
618static TileDirection BLANK_TILE_DIRECTION;
619static bool adjust_smooth_wall_dir(MapExtras::MapCache &map,
620 const DFCoord &pos,
621 TileDirection tdir = BLANK_TILE_DIRECTION) {
622 if (!is_smooth_wall(map, pos))
623 return is_connector(map, pos);
624
625 tdir = ensure_valid_tdir(get_adjacent_smooth_walls(map, pos, tdir));
626
627 df::tiletype tt = map.tiletypeAt(pos);
628 tt = findTileType(tileShape(tt), tileMaterial(tt), tileVariant(tt),
629 tileSpecial(tt), tdir);
630 if (tt == df::tiletype::Void)
631 return false;
632
633 map.setTiletypeAt(pos, tt);
634 return true;
635}
636
637static void refresh_adjacent_smooth_walls(MapExtras::MapCache &map,
638 const DFCoord &pos) {

Callers 3

smooth_tileFunction · 0.85

Calls 11

is_connectorFunction · 0.85
ensure_valid_tdirFunction · 0.85
findTileTypeFunction · 0.85
tileShapeFunction · 0.85
tileMaterialFunction · 0.85
tileVariantFunction · 0.85
tileSpecialFunction · 0.85
tiletypeAtMethod · 0.80
setTiletypeAtMethod · 0.80
is_smooth_wallFunction · 0.70

Tested by

no test coverage detected