Effect modfied speed overwrites base speed when editing player movement speeds
Issue #273
resolved
Setup
dnd5e: 1.4.1
obsidian: 5.0.8
Steps to reproduce:
- Change encumbrance setting to Variant
- Create player sheet
- Add item weighing 90 lb to sheet
- Observe that player walking speed is now 20
- Click on walking speed to open Manage Speed dialog
- Close Manage Speed dialog
Expected:
Walking speed continues to display 20. Disabling effect returns walking speed to 30.
Observed:
Walking speed now displays 10. Disabling effect only returns walking speed to 20. Each time the dialog is opened and closed while the effect is active walking speed decreases by a further 10.
Comments (2)
-
reporter -
repo owner - changed status to resolved
The 'new paradigm' around Document data involves overwriting the in-memory values under
data
directly now. The raw data that exists in the database is kept underdata._source
and doesn't get modified. What happened here was the derived data was being written to the sheet and then saved as though it were raw data.There might be a few more instances of this still lurking in the sheet.
- Log in to comment
It looks like the applySpeedBonuses function in js/data/bonuses.js applies the effects by overwriting the values in data.attributes.movement and doesn’t have a way to tell if the bonuses were already applied.