Merge branch 'craft3' into 'master'

BUG: Fix `CraftingLoad()` failing to properly handle nullish (i.e. unused) crafts

See merge request 
This commit is contained in:
BondageProjects 2025-03-31 00:00:43 +00:00
commit 257b25efe2
2 changed files with 8 additions and 4 deletions
BondageClub
Screens/Room/Crafting
Scripts

View file

@ -969,8 +969,12 @@ function CraftingLoad() {
// Re-enable previously disabled items if the player now owns them
for (const item of Player.Crafting) {
if (item == null) {
continue;
}
const asset = CraftingAssets[item.Item]?.[0];
if (item?.Disabled && asset && InventoryAvailable(Player, item.Name, asset.DynamicGroupName)) {
if (item.Disabled && asset && InventoryAvailable(Player, item.Name, asset.DynamicGroupName)) {
delete item.Disabled;
}
}

View file

@ -694,10 +694,10 @@ function InventoryCraft(Source, Target, GroupName, Craft, Refresh, PreConfigureI
Item.Property ??= {};
Item.Difficulty ??= Item.Asset.Difficulty;
// Sets the crafter name and ID
// Sets the crafter name and ID (if not already set)
if (Source) {
Item.Craft.MemberNumber = Source.MemberNumber;
Item.Craft.MemberName = CharacterNickname(Source);
Item.Craft.MemberNumber ??= Source.MemberNumber;
Item.Craft.MemberName ??= CharacterNickname(Source);
}
// Abort; the properties below are pre-configured by crafted items the first time they're applied,