Skip to content

Commit

Permalink
Update _preCreate to not use deprecated behavior
Browse files Browse the repository at this point in the history
Removes use of getOwnedItems from _preCreate.
Relies on a bit of a bandaid fix due to missing types, but should be
the correct way to handle that process.
  • Loading branch information
StasTserk committed Jun 29, 2021
1 parent 3ad63aa commit f87d3db
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions module/actors/BWActor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,17 +235,20 @@ export class BWActor<T extends BWActorData = BWActorData> extends Actor<T, BWIte
// we aren't the person who created this actor
return;
}
this.createOwnedItem([
{ name: "Instinct 1", type: "instinct", data: {}, img: constants.defaultImages.instinct},
{ name: "Instinct 2", type: "instinct", data: {}, img: constants.defaultImages.instinct},
{ name: "Instinct 3", type: "instinct", data: {}, img: constants.defaultImages.instinct},
{ name: "Instinct Special", type: "instinct", data: {}, img: constants.defaultImages.instinct},
{ name: "Belief 1", type: "belief", data: {}, img: constants.defaultImages.belief},
{ name: "Belief 2", type: "belief", data: {}, img: constants.defaultImages.belief},
{ name: "Belief 3", type: "belief", data: {}, img: constants.defaultImages.belief},
{ name: "Belief Special", type: "belief", data: {}, img: constants.defaultImages.belief},
{ ...constants.bareFistData, img: "icons/skills/melee/unarmed-punch-fist-yellow-red.webp" }
]);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
(this.data as any).update({
items: [
{ name: "Instinct 1", type: "instinct", data: {}, img: constants.defaultImages.instinct },
{ name: "Instinct 2", type: "instinct", data: {}, img: constants.defaultImages.instinct },
{ name: "Instinct 3", type: "instinct", data: {}, img: constants.defaultImages.instinct },
{ name: "Instinct Special", type: "instinct", data: {}, img: constants.defaultImages.instinct },
{ name: "Belief 1", type: "belief", data: {}, img: constants.defaultImages.belief },
{ name: "Belief 2", type: "belief", data: {}, img: constants.defaultImages.belief },
{ name: "Belief 3", type: "belief", data: {}, img: constants.defaultImages.belief },
{ name: "Belief Special", type: "belief", data: {}, img: constants.defaultImages.belief },
{ ...constants.bareFistData, img: "icons/skills/melee/unarmed-punch-fist-yellow-red.webp" }
]
});
}

async _preCreate(actor: Partial<T>, _options: FoundryDocument.CreateOptions, user: User): Promise<void> {
Expand Down

0 comments on commit f87d3db

Please sign in to comment.