Skip to content

Commit

Permalink
Release 2.1.0.
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyorl committed Jan 10, 2023
1 parent 4af6f42 commit 9a81781
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions module/data/item/templates/action.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export default class ActionTemplate extends foundry.abstract.DataModel {

/** @inheritdoc */
static migrateData(source) {
ActionTemplate.#migrateAbility(source);
ActionTemplate.#migrateAttackBonus(source);
ActionTemplate.#migrateCritical(source);
ActionTemplate.#migrateSave(source);
Expand All @@ -69,6 +70,16 @@ export default class ActionTemplate extends foundry.abstract.DataModel {

/* -------------------------------------------- */

/**
* Migrate the ability field.
* @param {object} source The candidate source data from which the model will be constructed.
*/
static #migrateAbility(source) {
if ( Array.isArray(source.ability) ) source.ability = source.ability[0];
}

/* -------------------------------------------- */

/**
* Ensure a 0 or null in attack bonus is converted to an empty string rather than "0".
* @param {object} source The candidate source data from which the model will be constructed.
Expand Down

0 comments on commit 9a81781

Please sign in to comment.