|
|
|
@ -968,10 +968,20 @@ static void post_process_dug_tiles(color_ostream &out,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (to.bits.item) {
|
|
|
|
|
for (auto item : world->items.other.IN_PLAY) {
|
|
|
|
|
if (item->pos == pos && item->flags.bits.on_ground)
|
|
|
|
|
item->moveToGround(
|
|
|
|
|
resting_pos.x, resting_pos.y, resting_pos.z);
|
|
|
|
|
std::vector<df::item*> items;
|
|
|
|
|
if (auto b = Maps::ensureTileBlock(pos)) {
|
|
|
|
|
for (auto item_id : b->items) {
|
|
|
|
|
auto item = df::item::find(item_id);
|
|
|
|
|
if (item && item->pos == pos)
|
|
|
|
|
items.emplace_back(item);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!items.empty()) {
|
|
|
|
|
// fresh MapCache since tile properties are being actively changed
|
|
|
|
|
MapExtras::MapCache mc;
|
|
|
|
|
for (auto item : items)
|
|
|
|
|
Items::moveToGround(mc, item, resting_pos);
|
|
|
|
|
mc.WriteAll();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|