Upgrade templates: PP, AP as string.

This commit is contained in:
Michael Stein
2023-04-18 23:54:58 +02:00
parent 5de5e043ae
commit f91c64f91f
4 changed files with 67 additions and 54 deletions
+13
View File
@@ -236,4 +236,17 @@ export class M5Item extends Item {
return (this as any).getEmbeddedDocument("Item", itemId)
}
override migrateSystemData(): any {
const item = (this as any)
const data = item.system
if (item.type === "spell") {
if (typeof data.ap !== "string") {
data.ap = Number.isFinite(data.ap) ? "" + data.ap : ""
}
}
return super.migrateSystemData()
}
}