Attribute Item Subtype #76

Merged
Oliver merged 50 commits from feature/attribute-items into main 2026-04-27 02:12:56 +00:00
Showing only changes of commit d2599d0db3 - Show all commits

View file

@ -72,6 +72,9 @@ export class AttributeItemData extends foundry.abstract.TypeDataModel {
}; };
async _preUpdate(data, options, user) { async _preUpdate(data, options, user) {
const allowed = await super._preUpdate(data, options, user);
if (allowed === false) { return false };
// Prevent invalid IDs // Prevent invalid IDs
if (hasProperty(data, `system.key`) && !isValidID(data.system.key)) { if (hasProperty(data, `system.key`) && !isValidID(data.system.key)) {
ui.notifications.error(_loc( ui.notifications.error(_loc(
@ -91,8 +94,6 @@ export class AttributeItemData extends foundry.abstract.TypeDataModel {
setProperty(data, `system.value`, clamp(min, value, max)); setProperty(data, `system.value`, clamp(min, value, max));
}; };
return super._preUpdate(data, options, user);
}; };
// #endregion Lifecycle // #endregion Lifecycle