Merge pull request #4031 from ab9rf/tailor-4023

exclude nonclothing from tailor's scan
develop
Myk 2023-11-16 08:19:00 -08:00 committed by GitHub
commit ed9e6c8233
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

@ -84,6 +84,7 @@ Template for new versions:
- `sort`: when filtering out already-established temples in the location assignment screen, also filter out the "No specific deity" option if a non-denominational temple has already been established
- RemoteServer: continue to accept connections as long as the listening socket is valid instead of closing the socket after the first disconnect
- `buildingplan`: overlay and filter editor gui now uses ctrl-d to delete the filter to avoid conflict with increasing the filter's minimum quality (shift-x)
- `tailor`: fix crash on Linux where scanned unit is wearing damaged non-clothing (e.g. a crown)
## Misc Improvements
- `buildingplan`: display how many items are available on the planner panel

@ -277,6 +277,9 @@ public:
{
if (inv->mode != df::unit_inventory_item::Worn)
continue;
// skip non-clothing
if (!inv->item->isClothing())
continue;
if (inv->item->getWear() > 0)
worn.push_back(inv->item);
else
@ -288,9 +291,17 @@ public:
for (auto w : worn)
{
// skip armor
if (w->getEffectiveArmorLevel() > 0)
continue;
auto ty = w->getType();
int isize = world->raws.creatures.all[w->getMakerRace()]->adultsize;
auto makerRace = w->getMakerRace();
if (makerRace < 0 || makerRace >= (int16_t) world->raws.creatures.all.size())
continue;
int isize = world->raws.creatures.all[makerRace]->adultsize;
std::string description;
w->getItemDescription(&description, 0);