BUG: Fix InventoryWear() ignoring explicitly passed colors in favor of Craft.Color

This commit is contained in:
bananarama92 2025-03-28 17:18:56 +01:00
parent 1a185e0318
commit 60ebf457f4
No known key found for this signature in database
GPG key ID: E83C7D3B5DA36248

View file

@ -820,10 +820,16 @@ function InventoryWear(C, AssetName, AssetGroup, ItemColor, Difficulty, MemberNu
if (A.ExpressionTrigger != null) {
InventoryExpressionTriggerApply(C, A.ExpressionTrigger);
}
if (Craft) {
// Restore the item color if it has been explicitly passed; keep using the `Craft.Color`-assigned color otherwise
const C_Source = Character.find(c => c.MemberNumber === MemberNumber) ?? null;
InventoryCraft(C_Source, C, /** @type {AssetGroupItemName} */(AssetGroup), Craft, false);
if (ItemColor != null) {
item.Color = color;
}
}
if (Refresh) {
CharacterRefresh(C, true);
}