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

This commit is contained in:
bananarama92 2025-03-30 15:00:36 +02:00
parent 1a185e0318
commit 17b7767a9e
No known key found for this signature in database
GPG key ID: E83C7D3B5DA36248

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;
}
}