From d0410304cf07f5651d679edb428858f8031ecb4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iohan=20Tr=C3=A9zze?= Date: Sat, 6 Jun 2026 15:07:51 -0300 Subject: [PATCH] [Fix] Simplify GoldField by using DataField's built-in initial property --- module/data/fields/actorField.mjs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/module/data/fields/actorField.mjs b/module/data/fields/actorField.mjs index 4a3156e5..e165f5cc 100644 --- a/module/data/fields/actorField.mjs +++ b/module/data/fields/actorField.mjs @@ -116,7 +116,7 @@ class ResourcesField extends fields.TypedObjectField { } class GoldField extends fields.SchemaField { - constructor({ initial, ...options } = {}) { + constructor(options = {}) { super( { coins: new fields.NumberField({ initial: 0, integer: true }), @@ -126,18 +126,6 @@ class GoldField extends fields.SchemaField { }, options ); - this._initialCallback = initial; - } - - getInitialValue(data) { - if (this._initialCallback) { - try { - return this._initialCallback(data); - } catch { - /* settings not yet available */ - } - } - return super.getInitialValue(data); } }