Update migration.js

Found a case where power migration could be skipped if the actor had no items
This commit is contained in:
supervj 2021-02-18 14:32:54 -05:00
parent d17515a59b
commit 6e37fd8306

View file

@ -131,7 +131,7 @@ export const migrateActorData = function(actor) {
_migrateActorSenses(actor, updateData);
// Migrate Owned Items
if ( !actor.items ) return updateData;
if ( !!actor.items ) {
let hasItemUpdates = false;
const items = actor.items.map(i => {
@ -152,6 +152,7 @@ export const migrateActorData = function(actor) {
} else return i;
});
if ( hasItemUpdates ) updateData.items = items;
}
// migrate powers last since it relies on item classes being migrated first.
_migrateActorPowers(actor, updateData);