mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-23 08:49:29 +00:00
Merge branch 'craft3' into 'master'
BUG: Fix `CraftingLoad()` failing to properly handle nullish (i.e. unused) crafts See merge request BondageProjects/Bondage-College!5507
This commit is contained in:
commit
257b25efe2
2 changed files with 8 additions and 4 deletions
BondageClub
|
@ -969,8 +969,12 @@ function CraftingLoad() {
|
||||||
|
|
||||||
// Re-enable previously disabled items if the player now owns them
|
// Re-enable previously disabled items if the player now owns them
|
||||||
for (const item of Player.Crafting) {
|
for (const item of Player.Crafting) {
|
||||||
|
if (item == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
const asset = CraftingAssets[item.Item]?.[0];
|
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;
|
delete item.Disabled;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -694,10 +694,10 @@ function InventoryCraft(Source, Target, GroupName, Craft, Refresh, PreConfigureI
|
||||||
Item.Property ??= {};
|
Item.Property ??= {};
|
||||||
Item.Difficulty ??= Item.Asset.Difficulty;
|
Item.Difficulty ??= Item.Asset.Difficulty;
|
||||||
|
|
||||||
// Sets the crafter name and ID
|
// Sets the crafter name and ID (if not already set)
|
||||||
if (Source) {
|
if (Source) {
|
||||||
Item.Craft.MemberNumber = Source.MemberNumber;
|
Item.Craft.MemberNumber ??= Source.MemberNumber;
|
||||||
Item.Craft.MemberName = CharacterNickname(Source);
|
Item.Craft.MemberName ??= CharacterNickname(Source);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Abort; the properties below are pre-configured by crafted items the first time they're applied,
|
// Abort; the properties below are pre-configured by crafted items the first time they're applied,
|
||||||
|
|
Loading…
Add table
Reference in a new issue