Open lplayer12893 opened 2 months ago
Confirmed as reproducible. It's not consistent, though. I'll try to figure out what specifically about the monsters/encounters triggers it
https://github.com/kakaroto/Beyond20/assets/10716475/3ef12b8d-fd30-4cb3-b319-f45914873cc0
looks like this occurs whenever you switch
from a statblock whose first-listed Action has a negative damage modifier eg 1d8 - 1
to a stat block whose first-listed action has any damage roll listed (ie, the first-listed action can't be Multiattack or something else without a damage roll)
Hi, Unfortunately, that's not a Beyond20 bug, but a DDB bug. When you switch tabs, it doesn't remove the statblock and put the new statblock in.. it looks like (likely for optimization reasons), it instead replaces the stats in the statblock and removes/edits the action texts, so as soon as Beyond20 modifies it (by adding the roll button), the ddb code can't find the blocks to edit and leaves them unmodified. You also get the issue between some other monsters where you'd get an action/attack from one monster remaining in the statblock of another monster which doesn't have that attack at all. One use case I found last week is if you have a Ghoul and a Beholder in the same encounter, the "random" digital dice button to roll for the beholder eye rays will change from a 1d4 or whatever, into a 1d20 + 5 when you switch from the ghoul to the beholder. I think the only solution for this might be that if we detect the statblock changed, we force the complete removal of the statblock and re-creation of it (by emulating clicking twice on the monster name to hide/show the statblock). I'll need to test how we could achieve that and if it would work. Ideally, DDB would fix the bug from their side.
The fact that it only occurs with negative damage modifiers is what has me curious. Possibly a regex that is looking for \u002d
but some statblocks send \u2212
(or vice versa)?
The fact that it only occurs with negative damage modifiers is what has me curious. Possibly a regex that is looking for
\u002d
but some statblocks send\u2212
(or vice versa)?
yeah, that's weird, I never noticed something that triggers that bug, unless maybe two statblocks are similar enough that DDB modifies the html instead of replacing it. To investigate!
All of the following is done in the dndbeyond Combat Tracker. When I select my homebrew monster (an NPC very similar to a drow mage) which has a Staff attack with one and two-handed damage values, then select another monster (a shadow demon which the NPC can summon) WITHOUT selecting the 'X' icon to close the first sheet, then the damage done by the second monster's attack is replaced with the damages from the first monster (the shadow demon's 2d6+3 becomes 1d6-1, and its 4d6+3 becomes 1d6-8). The attached images are what is displayed when the homebrew NPC is selected, when the shadow demon is selected without closing ('X') the NPC, and when the shadow demon is selected when you do close ('X') the NPC first. Finally, a short output from the browser console after the NPC and shadow demon were selected (w/o closing the NPC).
![beyond20_bug4](https://github.com/kakaroto/Beyond20/assets/3657389/c0309278-d906-4e0b-a449-96b05258b626)
The problem also occurs using a non-homebrew drow mage with the shadow demon.
Browser:
Firefox 125.0.2
Beyond20 Version(s):