mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-14 04:19:22 +00:00
Merge branch 'craft2' into 'master'
BUG: Fix `InventoryWear()` ignoring explicitly passed colors in favor of `Craft.Color` See merge request BondageProjects/Bondage-College!5499
This commit is contained in:
commit
5f2d3d6a53
1 changed files with 8 additions and 0 deletions
|
@ -715,6 +715,8 @@ function InventoryCraft(Source, Target, GroupName, Craft, Refresh, PreConfigureI
|
|||
Target, Item, Craft.TypeRecord,
|
||||
{ push: false, refresh: false, C_Source: Source, properties: Craft.ItemProperty },
|
||||
);
|
||||
} else {
|
||||
Object.assign(Item.Property, Craft.ItemProperty ?? {});
|
||||
}
|
||||
|
||||
// Applies a lock to the item
|
||||
|
@ -820,10 +822,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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue