From 61213d399e9daffa8ab72dbd5518a92d7864d9a2 Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Thu, 31 Dec 2020 12:20:32 +0100 Subject: [PATCH] use getOwnedItem instead of getEmbeddedEntity --- src/module/actor/actor-sheet.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/module/actor/actor-sheet.ts b/src/module/actor/actor-sheet.ts index e7c16819..a972964b 100644 --- a/src/module/actor/actor-sheet.ts +++ b/src/module/actor/actor-sheet.ts @@ -64,8 +64,8 @@ export class DS4ActorSheet extends ActorSheet { const id = $(ev.currentTarget).parents(".item").data("itemId"); - const item = duplicate(this.actor.getEmbeddedEntity("OwnedItem", id)); - setProperty(item, "data.equipped", !getProperty(item, "data.equipped")); + const item = duplicate(this.actor.getOwnedItem(id)); // getOwnedItem is typed incorrectly, it actually returns a ItemData, not an Item + setProperty(item, "data.equipped", !getProperty(item, "data.equipped")); // TODO: use "."" accessors instead, once typing has been fixed this.actor.updateOwnedItem(item); });