|
|
@ -977,16 +977,27 @@ bool Buildings::deconstruct(df::building *bld)
|
|
|
|
bld->queueDestroy();
|
|
|
|
bld->queueDestroy();
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return deconstructImmediately(bld);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool Buildings::deconstructImmediately(df::building *bld)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
using df::global::ui;
|
|
|
|
|
|
|
|
using df::global::world;
|
|
|
|
|
|
|
|
using df::global::ui_look_list;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CHECK_NULL_POINTER(bld);
|
|
|
|
|
|
|
|
|
|
|
|
/* Immediate destruction code path.
|
|
|
|
/* Immediate destruction code path.
|
|
|
|
Should only happen for abstract and unconstructed buildings.*/
|
|
|
|
Should only happen for abstract and unconstructed buildings.*/
|
|
|
|
|
|
|
|
|
|
|
|
if (bld->isSettingOccupancy())
|
|
|
|
if (bld->isSettingOccupancy())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
markBuildingTiles(bld, true);
|
|
|
|
markBuildingTiles(bld, true);
|
|
|
|
bld->cleanupMap();
|
|
|
|
bld->cleanupMap();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bld->removeUses(false, false);
|
|
|
|
bld->removeUses(false, false);
|
|
|
|
// Assume: no parties.
|
|
|
|
// Assume: no parties.
|
|
|
|
unlinkRooms(bld);
|
|
|
|
unlinkRooms(bld);
|
|
|
@ -997,16 +1008,16 @@ bool Buildings::deconstruct(df::building *bld)
|
|
|
|
// Assume: does not affect pathfinding
|
|
|
|
// Assume: does not affect pathfinding
|
|
|
|
bld->deconstructItems(false, false);
|
|
|
|
bld->deconstructItems(false, false);
|
|
|
|
// Don't clear arrows.
|
|
|
|
// Don't clear arrows.
|
|
|
|
|
|
|
|
|
|
|
|
bld->uncategorize();
|
|
|
|
bld->uncategorize();
|
|
|
|
delete bld;
|
|
|
|
delete bld;
|
|
|
|
|
|
|
|
|
|
|
|
if (world->selected_building == bld)
|
|
|
|
if (world->selected_building == bld)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
world->selected_building = NULL;
|
|
|
|
world->selected_building = NULL;
|
|
|
|
world->update_selected_building = true;
|
|
|
|
world->update_selected_building = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (int i = ui_look_list->items.size()-1; i >= 0; i--)
|
|
|
|
for (int i = ui_look_list->items.size()-1; i >= 0; i--)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
auto item = ui_look_list->items[i];
|
|
|
|
auto item = ui_look_list->items[i];
|
|
|
@ -1017,10 +1028,10 @@ bool Buildings::deconstruct(df::building *bld)
|
|
|
|
delete item;
|
|
|
|
delete item;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
Job::checkBuildingsNow();
|
|
|
|
Job::checkBuildingsNow();
|
|
|
|
Job::checkDesignationsNow();
|
|
|
|
Job::checkDesignationsNow();
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|