assumes that if the game let you designate a tile for track carving, it must be valid to do so.
| 687 | // assumes that if the game let you designate a tile for track carving, it must |
| 688 | // be valid to do so. |
| 689 | static 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 | |
| 712 | static bool produces_item(const boulder_percent_options &options, |
| 713 | MapExtras::MapCache &map, Random::MersenneRNG &rng, |
no test coverage detected