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

Function get_adjacent_smooth_walls

plugins/dig-now.cpp:588–600  ·  view source on GitHub ↗

adds adjacent smooth walls and doors to the given tdir

Source from the content-addressed store, hash-verified

586
587// adds adjacent smooth walls and doors to the given tdir
588static TileDirection get_adjacent_smooth_walls(MapExtras::MapCache &map,
589 const DFCoord &pos,
590 TileDirection tdir) {
591 if (is_smooth_wall_or_connector(map, DFCoord(pos.x, pos.y-1, pos.z)))
592 tdir.north = 1;
593 if (is_smooth_wall_or_connector(map, DFCoord(pos.x, pos.y+1, pos.z)))
594 tdir.south = 1;
595 if (is_smooth_wall_or_connector(map, DFCoord(pos.x-1, pos.y, pos.z)))
596 tdir.west = 1;
597 if (is_smooth_wall_or_connector(map, DFCoord(pos.x+1, pos.y, pos.z)))
598 tdir.east = 1;
599 return tdir;
600}
601
602// ensure we have at least two directions enabled (or 0) so we can find a
603// matching tiletype. The game chooses to curve "end piece" walls into

Callers 1

adjust_smooth_wall_dirFunction · 0.85

Calls 1

Tested by

no test coverage detected