-
Notifications
You must be signed in to change notification settings - Fork 15
Giant negative movement numbers in 5E 1.2.0, 0.7.8 #16
Comments
I have the same issue in 0.7.9; the "lightly encumbered" and "heavily encumbered" effects keep getting added and never removed, so I end up with tens of stacked "encumbered" effects. |
Known issue with the current implementation. I'm working on a fix but the holidays have kept me busy unfortunately. |
I've confirmed that this is a race condition caused when there are multiple clients open at the same time (which happens when there are multiple users logged in). When an item is updated or added/removed, all clients simultaneously attempt to set the encumbrance, which causes them to stack. Because the current logic removes all previous effects and then adds its own, the stacking always happens whenever there are multiple clients open. I attempted to fix this by updating the first found existing effect instead, but that does not solve the race condition that occurs when multiple clients try to create the effect at the same time, for the first time, or when switching between unencumbered and encumbered. @VanirDev do you want to have a chat about how to solve this? I'm happy to have a stab at it on my own, but I'm new to Foundry development and you may have some insight that I don't. Contact me at |
I've got a solution, and will be raising a pull request early this week once I've cleaned up my code. |
Great work! I'd love to see how you resolved the race condition. I've been frustratingly trying to find a way to execute code from the server's perspective instead of on a per-client basis, alas that doesn't seem possible. |
This is the same behaviour that is causing the error notifications that people are seeing such as this #20, as when a client doesn't have permission to update the actor, it'll attempt to do so anyway and produce the error. |
PR is open; I've got a game tomorrow night where I will be testing this. |
Thanks for this, I'll review it tomorrow when I have a chance. Let me know how your session goes, I'll probably use my own players as guinea pigs come Wednesday. |
For most of my actors, there are no issues but this particular actor is having massive constantly increasing negative numbers for all speeds anytime the actor's inventory is changed. The effects keep multiplying in that user and they cannot be deleted.
Export of the 5E actor: https://we.tl/t-Oqq6jmEfe6
The text was updated successfully, but these errors were encountered: