SalieriC / SWIM

A collection of macros for the SWADE system on Foundry with a focus on immersion (i.e. by using sound effects)
GNU General Public License v3.0
10 stars 12 forks source link

[BUG] Fear table macro does not use the provided fear modifier #149

Closed Shaeress closed 3 months ago

Shaeress commented 3 months ago

When using the Fear Table Macro, the default table roll formula is always used, without modifier provided by the user in the Fear dialogue.

Steps to reproduce: put in a modifier of 21 or higher. Expected result: Heart Attack every time. Observed result: Everything but Heart Attack.

According to the documentation (https://foundryvtt.com/api/v9/RollTable.html) the "draw" method accepts only a single "options" object as parameter, so Line 55 of fear_table.js should turn from const results = await fearTable.draw({ displayChat: false }, { roll }); to this const results = await fearTable.draw({ displayChat: false, roll });

After making this change on my end, the issues was resolved.

SalieriC commented 3 months ago

Thank you for your report. I will investigate. There are some more issues in there that needs to be taken care of anyway. Next time however I'd appreciate if you could use the template for bugs. Especially now that v12 released it is very important to me to know which version of Foundry and SWADE users are using to reproduce a bug.

Also please not that you are referring to an outdated version of the API. The current one can be found here: https://foundryvtt.com/api/

Shaeress commented 3 months ago

My apologies, I wasn't entirely sure how to do things! My first time looking into Foundry code, I guess I just took the first API hit on google. ;D

I will take those remarks on board and do a better job next time.

I was using version 2.6.1 of SWIM and Foundry version 11 build 315.

SalieriC commented 3 months ago

No problem. =)

I've taken a look and your solution indeed worked just fine, thank you very much. It'll be in the next version of SWIM. But that might be some time down the road, depending on how much v12 broke.