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

Function ensure_valid_tdir

plugins/dig-now.cpp:611–615  ·  view source on GitHub ↗

ensure we have at least two directions enabled (or 0) so we can find a matching tiletype. The game chooses to curve "end piece" walls into orthogonally adjacent hidden tiles, or uses a pillar if there are no such tiles. we take the easier, but not quite conformant, path here and always use a pillar for end pieces. If we want to become faithful to how the game does it, this code should be moved to

Source from the content-addressed store, hash-verified

609// longer adjacent to hidden tiles and convert them to pillars when we dig two
610// tiles away from such a wall end and reveal their adjacent hidden tile.
611static TileDirection ensure_valid_tdir(TileDirection tdir) {
612 if (tdir.sum() < 2)
613 tdir.whole = 0;
614 return tdir;
615}
616
617// connects adjacent smooth walls to our new smooth wall
618static TileDirection BLANK_TILE_DIRECTION;

Callers 2

adjust_smooth_wall_dirFunction · 0.85
smooth_tileFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected