mirror of
https://gitgud.io/BondageProjects/Bondage-College.git
synced 2025-04-25 17:59:34 +00:00
BUG: Fix ExtendedItemSetOptionByRecord()
failing to assign explicitly passed properties
This commit is contained in:
parent
c99c403046
commit
51a334920b
1 changed files with 7 additions and 2 deletions
|
@ -1336,6 +1336,11 @@ function ExtendedItemSetOptionByRecord(C, itemOrGroupName, typeRecord=null, opti
|
|||
const propertyKeys = new Set();
|
||||
/** @type {Set<keyof ItemProperties>} */
|
||||
const whiteListKeys = new Set(["OverridePriority"]);
|
||||
for (const key of whiteListKeys) {
|
||||
if (properties?.[key]) {
|
||||
propertyKeys.add(key);
|
||||
}
|
||||
}
|
||||
const previousOptions = ExtendedItemGatherOptions(item);
|
||||
|
||||
if (typeRecord != null) {
|
||||
|
@ -1397,11 +1402,11 @@ function ExtendedItemSetOptionByRecord(C, itemOrGroupName, typeRecord=null, opti
|
|||
}
|
||||
|
||||
if (properties != null) {
|
||||
const invalidProperties = CommonKeys(properties).filter(i => !propertyKeys.has(i) && !whiteListKeys.has(i));
|
||||
const invalidProperties = CommonKeys(properties).filter(i => !propertyKeys.has(i));
|
||||
if (invalidProperties.length > 0) {
|
||||
console.warn("Ignoring unsanctioned/invalid item properties", invalidProperties.sort());
|
||||
}
|
||||
Object.assign(item, CommonPick(properties, propertyKeys));
|
||||
Object.assign((item.Property ??= {}), CommonPick(properties, propertyKeys));
|
||||
}
|
||||
|
||||
if (refresh || refresh == null) {
|
||||
|
|
Loading…
Add table
Reference in a new issue