Skip to content

Commit 3835788

Browse files
committed
a
1 parent 431142e commit 3835788

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
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

+5-1
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,13 @@ export function initConfig() {
636636
if (consumeType === "ammo") {
637637
const ammoItem = this.actor.items.get(this.item.system.consume.target);
638638
if (!ammoItem) return null;
639-
return ammoItem.system.quantity;
639+
return Math.floor((ammoItem.system.quantity ?? 0) / this.item.system.consume.amount);
640640
} else if (consumeType === "attribute") {
641641
return getProperty(this.actor.system, this.item.system.consume.target);
642+
} else if (consumeType === "charges") {
643+
const chargesItem = this.actor.items.get(this.item.system.consume.target);
644+
if (!chargesItem) return null;
645+
return Math.floor((chargesItem.system.uses?.value ?? 0) / this.item.system.consume.amount);
642646
} else if (showQuantityItemTypes.includes(this.item.type)) {
643647
return this.item.system.uses?.value ?? this.item.system.quantity;
644648
} else if (this.item.system.uses.value !== null) {

0 commit comments

Comments
 (0)