forked from GitHub-Mirrors/foundry-sw5e
Update migration.js
Found a case where power migration could be skipped if the actor had no items
This commit is contained in:
parent
d17515a59b
commit
6e37fd8306
1 changed files with 19 additions and 18 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue