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

Function carve_tile

plugins/dig-now.cpp:689–710  ·  view source on GitHub ↗

assumes that if the game let you designate a tile for track carving, it must be valid to do so.

Source from the content-addressed store, hash-verified

687// assumes that if the game let you designate a tile for track carving, it must
688// be valid to do so.
689static bool carve_tile(MapExtras::MapCache &map,
690 const DFCoord &pos, df::tile_occupancy &to) {
691 df::tiletype tt = map.tiletypeAt(pos);
692 TileDirection tdir = tileDirection(tt);
693
694 if (to.bits.carve_track_north)
695 tdir.north = 1;
696 if (to.bits.carve_track_east)
697 tdir.east = 1;
698 if (to.bits.carve_track_south)
699 tdir.south = 1;
700 if (to.bits.carve_track_west)
701 tdir.west = 1;
702
703 tt = findTileType(tileShape(tt), tileMaterial(tt), tileVariant(tt),
704 df::tiletype_special::TRACK, tdir);
705 if (tt == df::tiletype::Void)
706 return false;
707
708 map.setTiletypeAt(pos, tt);
709 return true;
710}
711
712static bool produces_item(const boulder_percent_options &options,
713 MapExtras::MapCache &map, Random::MersenneRNG &rng,

Callers 1

do_digFunction · 0.85

Calls 7

tileDirectionFunction · 0.85
findTileTypeFunction · 0.85
tileShapeFunction · 0.85
tileMaterialFunction · 0.85
tileVariantFunction · 0.85
tiletypeAtMethod · 0.80
setTiletypeAtMethod · 0.80

Tested by

no test coverage detected