mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 21:21:08 +01:00
Merged in release to fix history
This commit is contained in:
parent
633600f271
commit
3d05c7fe0a
1 changed files with 2 additions and 6 deletions
|
|
@ -82,11 +82,8 @@ export class ActionsField extends MappingField {
|
||||||
*/
|
*/
|
||||||
export class ActionField extends foundry.data.fields.ObjectField {
|
export class ActionField extends foundry.data.fields.ObjectField {
|
||||||
getModel(value) {
|
getModel(value) {
|
||||||
if(value && !value.type) value.type = 'attack';
|
if (value && !value.type) value.type = 'attack';
|
||||||
return (
|
return game.system.api.models.actions.actionsTypes[value.type] ?? null;
|
||||||
game.system.api.models.actions.actionsTypes[value.type] ??
|
|
||||||
null
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
@ -103,7 +100,6 @@ export class ActionField extends foundry.data.fields.ObjectField {
|
||||||
|
|
||||||
/** @override */
|
/** @override */
|
||||||
initialize(value, model, options = {}) {
|
initialize(value, model, options = {}) {
|
||||||
if(value && !value.type) value.type = 'attack';
|
|
||||||
const cls = this.getModel(value);
|
const cls = this.getModel(value);
|
||||||
if (cls) return new cls(value, { parent: model, ...options });
|
if (cls) return new cls(value, { parent: model, ...options });
|
||||||
return foundry.utils.deepClone(value);
|
return foundry.utils.deepClone(value);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue