Skip to content

Commit

Permalink
[#5248] Fix enchantment overrides on images not reverting
Browse files Browse the repository at this point in the history
Closes #5248
  • Loading branch information
arbron committed Feb 25, 2025
1 parent a9f9a10 commit 7ea7956
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions module/applications/item/sheet-v2-mixin.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ export default function ItemSheetV2Mixin(Base) {
editable: this.item._source.name,
field: this.item.schema.getField("name")
};
context.img = {
value: this.item.img,
editable: this.item._source.img
};

if ( ("identified" in this.item.system) && (identified === false) ) {
context.name = {
Expand Down
3 changes: 2 additions & 1 deletion templates/items/item-sheet-2.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
{{!-- Image --}}
<div class="left">

<img class="item-image" src="{{ item.img }}" alt="{{ name.value }}" {{#if editable}}data-edit="img"{{/if}}>
<img class="item-image" src="{{ifThen editable img.editable img.value }}" alt="{{ name.value }}"
{{#if editable}}data-edit="img"{{/if}}>

</div>

Expand Down

0 comments on commit 7ea7956

Please sign in to comment.