RedReign / FoundryVTT-BetterRolls5e

A module for modifying certain sheet functions on Foundry VTT Character sheets for D&D 5th Edition.
GNU General Public License v3.0
37 stars 67 forks source link

Issue with ammunition #377

Open jacobgrieninger opened 2 years ago

jacobgrieninger commented 2 years ago

When I add ammunition consumption to an item and then try to roll, nothing will occur. If I remove the ammunition consumption it will roll, or if I disable better rolls and have the item consume ammo, it will roll and consume. Any suggestions?

Zakkon commented 2 years ago

Hi! I encountered this bug aswell. Luckily, it's an easy fix. I made a pull request here: https://github.com/RedReign/FoundryVTT-BetterRolls5e/pull/378

But you can also find the entire scripts/custom-roll.js file here (bugfix included) if you don't want to wait for the next BetterRolls release: https://gitlab.com/-/snippets/2309757

jacobgrieninger commented 2 years ago

Thanks! Dragged and dropped this in and everything works. Guess we'll wait for an update

erlendaakre commented 2 years ago

@jacobgrieninger Are you able to reopen this for visibility for the devs, even though there is a workaround?

jacobgrieninger commented 2 years ago

Sure. Good idea

cs96and commented 2 years ago

I've submitted a pull request that fixes this issue and #380. I think my pull request is slightly "more correct" than @Zakkon 's #378 as it calls correctly calls updateEmbeddedDocuments

123mind123 commented 2 years ago

This problem is still going. Thanks for the fix cs96and. It works perfectly with it.

shecrio commented 2 years ago

here's the console error for this

helpers.mjs:428 Uncaught (in promise) Error: The provided data is not an object! [Detected 1 package: betterrolls5e] at isObjectEmpty (helpers.mjs:428) at CustomItemRoll.roll (custom-roll.js:705) at async CustomItemRoll.toMessage (custom-roll.js:824) isObjectEmpty @ helpers.mjs:428 roll @ custom-roll.js:705 Promise.then (async) 🎁call_wrapper @ libWrapper-wrapper.js:630 🎁CONFIG.Item.documentClass.prototype.roll#0 @ libWrapper-wrapper.js:189 _onItemRoll @ base.js:931 (anonymous) @ base.js:612 dispatch @ jquery.min.js:2 v.handle @ jquery.min.js:2