use getOwnedItem instead of getEmbeddedEntity

This commit is contained in:
Johannes Loher 2020-12-31 12:20:32 +01:00
parent 6fac2c597f
commit 61213d399e

View file

@ -64,8 +64,8 @@ export class DS4ActorSheet extends ActorSheet<DS4ActorDataType, DS4Actor, DS4Ite
html.find(".item-equip").on("click", (ev) => { html.find(".item-equip").on("click", (ev) => {
const id = $(ev.currentTarget).parents(".item").data("itemId"); const id = $(ev.currentTarget).parents(".item").data("itemId");
const item = duplicate(this.actor.getEmbeddedEntity("OwnedItem", id)); const item = duplicate(this.actor.getOwnedItem(id)); // getOwnedItem is typed incorrectly, it actually returns a ItemData<DS4ItemDataType>, not an Item
setProperty(item, "data.equipped", !getProperty(item, "data.equipped")); setProperty(item, "data.equipped", !getProperty(item, "data.equipped")); // TODO: use "."" accessors instead, once typing has been fixed
this.actor.updateOwnedItem(item); this.actor.updateOwnedItem(item);
}); });