Drakula
April 5th, 2023, 17:13
I have discovered a bug in FGU where if you override the ActionsManager.onDiceLanded function the chat output is shown twice (see image)
56969
The bottom result is the error one (as you can see it doesn't show the GM icon) I have been able to recreate this with a new extension that does nothing else but this, here is the code
function onInit()
if ActionsManager.onDiceLanded then
old_onDiceLanded = ActionsManager.onDiceLanded;
end
ActionsManager.onDiceLanded = test_onDiceLanded;
end
function test_onDiceLanded(dragdata)
if old_onDiceLanded then
old_onDiceLanded(dragdata);
end
end
All it does is call the old onDiceLanded, if I remove the override code (in onInit) the output returns to normal (only shows the top output in the image).
56970
However if I remove the code from test_onDiceLanded and have it do nothing then (as expected) it doesn't show the top result but it still shows the bottom result
56971
This doesn't affect the usage of the roll (e.g. checking if hit or applying damage delt) so it is not a critical error, however it is annoying having all dice rolls show in chat twice.
This is a bug that has existed for some time as I hadn't updated FGU since the LOS and Lighting were added but when I discovered the bug I updated to the latest version (v4.3.7 2023-03-28) and it is still there. I tried looking for a post about this but couldn't find one probably because overriding onDiceLanded hasn't been tried before, or at least not very often, so it hasn't been noticed/reported before.
I understand this isn't a game breaking bug so don't expect it to be a high priority or anything so if anyone can think of a way I could fix it myself that would be great, but other than that I just wanted to let the dev know about it.
Thanks.
<edit>
I forgot to mention that I am using 5e ruleset
</edit>
56969
The bottom result is the error one (as you can see it doesn't show the GM icon) I have been able to recreate this with a new extension that does nothing else but this, here is the code
function onInit()
if ActionsManager.onDiceLanded then
old_onDiceLanded = ActionsManager.onDiceLanded;
end
ActionsManager.onDiceLanded = test_onDiceLanded;
end
function test_onDiceLanded(dragdata)
if old_onDiceLanded then
old_onDiceLanded(dragdata);
end
end
All it does is call the old onDiceLanded, if I remove the override code (in onInit) the output returns to normal (only shows the top output in the image).
56970
However if I remove the code from test_onDiceLanded and have it do nothing then (as expected) it doesn't show the top result but it still shows the bottom result
56971
This doesn't affect the usage of the roll (e.g. checking if hit or applying damage delt) so it is not a critical error, however it is annoying having all dice rolls show in chat twice.
This is a bug that has existed for some time as I hadn't updated FGU since the LOS and Lighting were added but when I discovered the bug I updated to the latest version (v4.3.7 2023-03-28) and it is still there. I tried looking for a post about this but couldn't find one probably because overriding onDiceLanded hasn't been tried before, or at least not very often, so it hasn't been noticed/reported before.
I understand this isn't a game breaking bug so don't expect it to be a high priority or anything so if anyone can think of a way I could fix it myself that would be great, but other than that I just wanted to let the dev know about it.
Thanks.
<edit>
I forgot to mention that I am using 5e ruleset
</edit>