mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Fix/attack type migrate data (#949)
* Temp ActionField attack type missing * Move missing attack type to getModel * Move attack type fix to actor migratedata
This commit is contained in:
parent
ba42892eed
commit
16e931179f
2 changed files with 8 additions and 1 deletions
|
|
@ -82,7 +82,6 @@ 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';
|
|
||||||
return game.system.api.models.actions.actionsTypes[value.type] ?? null;
|
return game.system.api.models.actions.actionsTypes[value.type] ?? null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,14 @@ export default class DhpActor extends Actor {
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
|
/** @inheritDoc */
|
||||||
|
static migrateData(source) {
|
||||||
|
if(source.system?.attack && !source.system.attack.type) source.system.attack.type = "attack";
|
||||||
|
return super.migrateData(source);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
|
||||||
/**@inheritdoc */
|
/**@inheritdoc */
|
||||||
static getDefaultArtwork(actorData) {
|
static getDefaultArtwork(actorData) {
|
||||||
const { type } = actorData;
|
const { type } = actorData;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue