| 100 | }; |
| 101 | |
| 102 | static void scan_building(color_ostream &out, df::building * bld, Expected & expected) { |
| 103 | for (int y = bld->y1; y <= bld->y2; ++y) { |
| 104 | for (int x = bld->x1; x <= bld->x2; ++x) { |
| 105 | if (!Buildings::containsTile(bld, df::coord2d(x, y))) |
| 106 | continue; |
| 107 | auto expected_bld = expected.bld(x, y, bld->z); |
| 108 | if (bld->isSettingOccupancy() && expected_bld) { |
| 109 | if (*expected_bld) { |
| 110 | WARN(log,out).print("Buildings overlap at ({}, {}, {}); please manually remove overlapping building." |
| 111 | " Run ':lua dfhack.gui.revealInDwarfmodeMap({}, {}, {}, true, true)' to zoom to the tile.\n", |
| 112 | x, y, bld->z, x, y, bld->z); |
| 113 | } |
| 114 | *expected_bld = bld; |
| 115 | } |
| 116 | if (auto expected_occ = expected.occ(x, y, bld->z)) { |
| 117 | auto bld_occ = df::tile_building_occ::Impassable; |
| 118 | if (auto block_occ = Maps::getTileOccupancy(x, y, bld->z)) |
| 119 | bld_occ = block_occ->bits.building; |
| 120 | expected_occ->bits.building = bld_occ; |
| 121 | } |
| 122 | } |
| 123 | } |
| 124 | } |
| 125 | |
| 126 | static void scan_unit(df::unit * unit, Expected & expected) { |
| 127 | if (unit->flags1.bits.caged || unit->flags1.bits.inactive || unit->flags1.bits.rider) |