Skip to content

Commit 64496b7

Browse files
committed
a
1 parent c064e28 commit 64496b7

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

index.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/config.js

+8
Original file line numberDiff line numberDiff line change
@@ -818,10 +818,18 @@ export function initConfig() {
818818
}
819819

820820
get quantity() {
821+
if (this.item.system.uses?.max) return this.item.system.uses.max - this.item.system.uses.spent;
821822
if (!this.activity) return null;
822823
const showQuantityItemTypes = ["consumable"];
823824
const consumeType = this.activity?.consume?.type;
824825
const useAmmo = this.item.system.ammunition?.type;
826+
const useOtherItem = this.activity?.consumption?.targets?.find(t => t.type === "itemUses");
827+
if (useOtherItem) {
828+
const otherItem = this.actor.items.get(useOtherItem.target);
829+
if (otherItem && otherItem.system.uses?.max) {
830+
return otherItem.system.uses.max - otherItem.system.uses.spent;
831+
}
832+
}
825833
if (useAmmo) {
826834
const ammoItem = this.item.system.ammunitionOptions[0]?.item;
827835
if (!ammoItem) return null;

0 commit comments

Comments
 (0)