Merge branch 'master' into 050-basic-active-effects

This commit is contained in:
Johannes Loher 2021-02-11 12:10:14 +01:00
commit ac84d40528
7 changed files with 131 additions and 80 deletions

View file

@ -72,8 +72,15 @@ export class DS4ActorSheet extends ActorSheet<ActorSheet.Data<DS4Actor>> {
// Update Inventory Item
html.find(".item-edit").on("click", (ev) => {
const li = $(ev.currentTarget).parents(".item");
const item = this.actor.getOwnedItem(li.data("itemId"));
item.sheet?.render(true);
const id = li.data("itemId");
const item = this.actor.getOwnedItem(id);
if (!item) {
throw new Error(game.i18n.format("DS4.ErrorActorDoesNotHaveItem", { id, actor: this.actor.name }));
}
if (!item.sheet) {
throw new Error(game.i18n.localize("DS4.ErrorUnexpectedError"));
}
item.sheet.render(true);
});
// Delete Inventory Item