Skip to content

The rulers for the DV Calculation is broken for tables with regexp characters in the name [such as (Autofire)]

Description of problem

When selecting a DV table that has () in it (such as Assault Rifle (Autofire)), the rule breaks.

Version-release number of Foundry VTT & Cyberpunk RED Core

0.81.1

Have you been able to reproduce issue?

Yes

Steps to Reproduce

  1. Right click token and pick a DV table that has () in the name
  2. Try to measure
  3. Observer nothing.

Actual results

No measurement occurs.

Expected results:

Measurement occurs with DV populated.

Additional info

The issue is it trying to match the table name using Regexp and () are special characters in a Regular Expression. There's really no need to do a RegExp search on this since it is an exact match of the table name anyway.

This can be worked around in a game if needed by simply editing the roll table and changing the name of it to remove the (). Replacing with dashes will work as well. If you are not familiar with Regular Expressions, the recommendation is to just remove the () from the name and leave the contents ie Assault Rifle Autofire