File tree Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Expand file tree Collapse file tree 3 files changed +23
-2
lines changed Original file line number Diff line number Diff line change 1+ import { ActorPF2e } from "@actor" ;
2+ import { ActorSizePF2e } from "@actor/data/size.ts" ;
3+ import { TokenSource } from "@common/documents/token.mjs" ;
4+ import { MigrationBase } from "../base.ts" ;
5+
6+ /**
7+ * Token dimensions are read from source data as of V13, leaving some tokens that were resized in memory now at the
8+ * incorrect size.
9+ */
10+ export class Migration939SetTokenDimensions extends MigrationBase {
11+ static override version = 0.939 ;
12+
13+ override async updateToken ( source : TokenSource , actor : Readonly < ActorPF2e | null > ) : Promise < void > {
14+ const actorSize = actor ?. system . traits ?. size ;
15+ if ( ! ( actorSize instanceof ActorSizePF2e ) ) return ;
16+ const { width, length : height } = actorSize ;
17+ source . width = width ;
18+ source . height = height ;
19+ }
20+ }
Original file line number Diff line number Diff line change @@ -237,3 +237,4 @@ export { Migration935DeityIconPaths } from "./935-deity-icon-paths.ts";
237237export { Migration936MoveWorldClockSettings } from "./936-move-world-created-on.ts" ;
238238export { Migration937RemoveInvalidAuraTraits } from "./937-remove-invalid-aura-traits.ts" ;
239239export { Migration938RenameBroochesAndThroned } from "./938-rename-brooches-and-throned.ts" ;
240+ export { Migration939SetTokenDimensions } from "./939-set-token-dimensions.ts" ;
Original file line number Diff line number Diff line change @@ -14,13 +14,13 @@ interface CollectionDiff<T extends foundry.documents.ActiveEffectSource | ItemSo
1414export class MigrationRunnerBase {
1515 migrations : MigrationBase [ ] ;
1616
17- static LATEST_SCHEMA_VERSION = 0.938 ;
17+ static LATEST_SCHEMA_VERSION = 0.939 ;
1818
1919 static MINIMUM_SAFE_VERSION = 0.7 ;
2020
2121 static RECOMMENDED_SAFE_VERSION = 0.84 ;
2222
23- /** The minimum schema version for the foundry version number */
23+ /** The starting schema version for the Foundry generation number */
2424 static FOUNDRY_SCHEMA_VERSIONS = {
2525 0.8 : 0.634 ,
2626 9 : 0.7 ,
You can’t perform that action at this time.
0 commit comments