| 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) |
| 128 | return; |
| 129 | if (auto craw = df::creature_raw::find(unit->race); craw && craw->flags.is_set(df::creature_raw_flags::EQUIPMENT_WAGON)) { |
| 130 | for (int y = unit->pos.y - 1; y <= unit->pos.y + 1; ++y) { |
| 131 | for (int x = unit->pos.x - 1; x <= unit->pos.x + 1; ++x) { |
| 132 | if (auto expected_occ = expected.occ(x, y, unit->pos.z)) { |
| 133 | expected_occ->bits.unit = expected_occ->bits.unit || !unit->flags1.bits.on_ground; |
| 134 | expected_occ->bits.unit_grounded = expected_occ->bits.unit_grounded || unit->flags1.bits.on_ground; |
| 135 | } |
| 136 | } |
| 137 | } |
| 138 | } else if (auto expected_occ = expected.occ(unit->pos)) { |
| 139 | expected_occ->bits.unit = expected_occ->bits.unit || !unit->flags1.bits.on_ground; |
| 140 | expected_occ->bits.unit_grounded = expected_occ->bits.unit_grounded || unit->flags1.bits.on_ground; |
| 141 | } |
| 142 | } |
| 143 | |
| 144 | static void scan_item(df::item * item, Expected & expected) { |
| 145 | if (!item->flags.bits.on_ground) |