File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
packages/bot/src/commands/roll Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -85,10 +85,12 @@ export async function baseRoll(
8585
8686 let opposition : ComparedValue | undefined ;
8787 const evaluated = DICE_COMPILED_PATTERNS . TARGET_VALUE . exec ( dice ) ;
88- logger . trace ( "Evaluated dice regex result:" , evaluated ) ;
88+ logger . trace ( "Evaluated dice regex result" + " :", evaluated ) ;
8989 if ( ! evaluated ) {
90+ // Preclean to ignore {cs|cf:...} blocs before checking for opposition
91+ const contentForOpposition = dice . replace ( REMOVER_PATTERN . CRITICAL_BLOCK , "" ) ;
9092 // Remove the second comparator for opposition rolls (e.g., 1d20>15>20 becomes 1d20>15)
91- const oppositionMatch = DICE_COMPILED_PATTERNS . OPPOSITION . exec ( dice ) ;
93+ const oppositionMatch = DICE_COMPILED_PATTERNS . OPPOSITION . exec ( contentForOpposition ) ;
9294 opposition = parseComparator ( dice , userData ?. stats , undefined ) ;
9395 logger . trace ( "Opposition match regex result:" , oppositionMatch , opposition ) ;
9496 if ( oppositionMatch ?. groups ?. second )
You can’t perform that action at this time.
0 commit comments