From b76333ae877ca91106a5b61b0debae347e60c0e1 Mon Sep 17 00:00:00 2001 From: Kelly Kinkade Date: Mon, 21 Aug 2023 12:46:24 -0500 Subject: [PATCH] `tailor`: remove crash clothing items may have an invalid maker race; this should not happen but it does so we have to deal with it --- docs/changelog.txt | 1 + plugins/tailor.cpp | 3 +++ 2 files changed, 4 insertions(+) diff --git a/docs/changelog.txt b/docs/changelog.txt index b8db746af..0ef3d5cf5 100644 --- a/docs/changelog.txt +++ b/docs/changelog.txt @@ -29,6 +29,7 @@ Template for new versions: ## New Features ## Fixes +- `tailor`: remove crash caused by clothing items with an invalid ``maker_race`` ## Misc Improvements diff --git a/plugins/tailor.cpp b/plugins/tailor.cpp index df8781caa..af2a61e4a 100644 --- a/plugins/tailor.cpp +++ b/plugins/tailor.cpp @@ -186,6 +186,9 @@ public: } if (i->getWear() >= 1) continue; + if (i->getMakerRace() < 0) // sometimes we get borked items with no valid maker race + continue; + df::item_type t = i->getType(); int size = world->raws.creatures.all[i->getMakerRace()]->adultsize;