Issue: Save rolls and panic checks display incorrect target value (NaN) on character sheets
Closed this issue · 2 comments
Description:
In FoundryVTT using the "MoSh - Unofficial Mothership" game system, when trying to roll any save (Sanity, Fear, Body) by clicking on the save text on a character sheet or when doing a panic check by clicking on Stress, the Target value is displayed as NaN. This issue might be due to the Mod value being NaN, which then is added to the Sanity score (or other save scores) resulting in an incorrect NaN value. The expected behaviour is that if there is no value (empty or undefined), it should be treated as zero.
Steps to reproduce:
- Open FoundryVTT and start a world using the "MoSh - Unofficial Mothership" game system.
- Open a character sheet.
- Click on any save text (Sanity, Fear, Body) or click on Stress for performing a panic check.
- Observe that the result displays Target and Mod as NaN.
Expected behaviour:
The Target value should display the correct sum of the save score and any modifier value present. If there's no modifier value (empty or undefined), it should be treated as zero.
Actual behavior:
The Target and Mod value displays NaN.
Additional information:
Here's an example of the output when rolling Sanity:
<div class="rollcontainer">
<div class="rollh1">SANITY</div>
<div class="rollh2">Failure</div>
<div class="roll-grid">
<div class="roll-result">45</div>
</div>
<div class="roll-target">
<div class="valuetext">Target:</div>
<div class="roll-targetbox">
<div class="value">NaN</div>
</div>
</div>
<div class="rollmods">
<div class="valuetext">SANITY (17)</div>
<div class="valuetext">Mod (NaN)</div>
</div>
</div>
Environment:
- FoundryVTT version: Version 11 Stable Build 300
- MoSh - Unofficial Mothership RPG version: 0.3.6
- Browser: Google Chrome Version 113.0.5672.126 (Official Build) (arm64)
- OS: macOS 13.3.1
Fixed!
Thank you, I can confirm this has been addressed for both characters and enemies.