Foundryv14 migration
This commit is contained in:
@@ -12,4 +12,14 @@ export default class EquipementDataModel extends foundry.abstract.TypeDataModel
|
||||
equipped: new fields.BooleanField({ initial: false })
|
||||
};
|
||||
}
|
||||
|
||||
static migrateData(data) {
|
||||
for (const key of ["rarete", "quantite", "prix"]) {
|
||||
if (typeof data[key] === "string") {
|
||||
const v = parseInt(data[key]);
|
||||
data[key] = Number.isNaN(v) ? 0 : v;
|
||||
}
|
||||
}
|
||||
return data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user