Foundryv14 migration

This commit is contained in:
2026-04-01 22:19:03 +02:00
parent 038aa37838
commit a11d9be830
91 changed files with 241 additions and 207 deletions

View File

@@ -13,4 +13,14 @@ export default class AccessoireDataModel extends foundry.abstract.TypeDataModel
lieu: new fields.NumberField({ initial: 0, integer: true })
};
}
static migrateData(data) {
for (const key of ["rarete", "quantite", "prix", "lieu"]) {
if (typeof data[key] === "string") {
const v = parseInt(data[key]);
data[key] = Number.isNaN(v) ? 0 : v;
}
}
return data;
}
}

View File

@@ -27,4 +27,14 @@ export default class ArmeDataModel extends foundry.abstract.TypeDataModel {
special: new fields.StringField({ initial: "" })
};
}
static migrateData(data) {
for (const key of ["rarete", "quantite", "prix", "degats", "precision", "magasin", "charge", "zone"]) {
if (typeof data[key] === "string") {
const v = parseInt(data[key]);
data[key] = Number.isNaN(v) ? 0 : v;
}
}
return data;
}
}

View File

@@ -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;
}
}

View File

@@ -17,4 +17,14 @@ export default class ProtectionDataModel extends foundry.abstract.TypeDataModel
dissimulation: new fields.StringField({ initial: "" })
};
}
static migrateData(data) {
for (const key of ["rarete", "quantite", "prix", "points", "malusagilite"]) {
if (typeof data[key] === "string") {
const v = parseInt(data[key]);
data[key] = Number.isNaN(v) ? 0 : v;
}
}
return data;
}
}