Make workflow consider squad-assigned items busy.

develop
Alexander Gavrilov 2012-11-08 21:27:56 +04:00
parent 0c70a448d0
commit a7bf526f41
2 changed files with 10 additions and 1 deletions

@ -21,6 +21,7 @@ DFHack future
- properly considers minecarts assigned to routes busy.
- code for deducing job outputs rewritten in lua for flexibility.
- logic fix: collecting webs produces silk, and ungathered webs are not thread.
- items assigned to squads are considered busy, even if not in inventory.
New Fix Armory plugin:
Together with a couple of binary patches and the gui/assign-rack script,
this plugin makes weapon racks, armor stands, chests and cabinets in

@ -1004,6 +1004,12 @@ static bool isRouteVehicle(df::item *item)
return vehicle && vehicle->route_id >= 0;
}
static bool isAssignedSquad(df::item *item)
{
auto &vec = ui->equipment.items_assigned[item->getType()];
return binsearch_index(vec, &df::item::id, item->id) >= 0;
}
static void map_job_items(color_ostream &out)
{
for (size_t i = 0; i < constraints.size(); i++)
@ -1117,8 +1123,10 @@ static void map_job_items(color_ostream &out)
item->isAssignedToStockpile() ||
isRouteVehicle(item) ||
itemInRealJob(item) ||
itemBusy(item))
itemBusy(item) ||
isAssignedSquad(item))
{
is_invalid = true;
cv->item_inuse++;
}
else