Merge pull request #247 from jjtParadox/fix/ammo-consumption

Fix for attack ammo being consumed even if the roll dialog is canceled
This commit is contained in:
CK 2021-08-05 19:25:38 -04:00 committed by GitHub
commit 71872e82d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1039,7 +1039,7 @@ export default class Item5e extends Item {
// Invoke the d20 roll helper
const roll = await d20Roll(rollConfig);
if (roll === false) return null;
if (!roll) return null;
// Commit ammunition consumption on attack rolls resource consumption if the attack roll was made
if (ammo && !isObjectEmpty(ammoUpdate)) await ammo.update(ammoUpdate);