From 2161a8e92a02831f1478f9b41b9ed6f38ebb95ad Mon Sep 17 00:00:00 2001 From: Johannes Loher Date: Thu, 1 Jul 2021 02:09:34 +0200 Subject: [PATCH] Avoid min and max rolls being highlighted incorrectly --- src/module/rolls/check.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/module/rolls/check.ts b/src/module/rolls/check.ts index a31967ec..212eef0d 100644 --- a/src/module/rolls/check.ts +++ b/src/module/rolls/check.ts @@ -107,6 +107,16 @@ export class DS4Check extends DiceTerm { this.fumble = results[0].failure ?? false; } + /** + * @override + * @remarks "min" and "max" are filtered out because they are irrelevant for + * {@link DS4Check}s and only result in some dice rolls being highlighted + * incorrectly. + */ + getResultCSS(result: DiceTerm.Result): (string | null)[] { + return super.getResultCSS(result).filter((cssClass) => cssClass !== "min" && cssClass !== "max"); + } + static readonly DEFAULT_CHECK_TARGET_NUMBER = 10; static readonly DEFAULT_MAXIMUM_COUP_RESULT = 1; static readonly DEFAULT_MINIMUM_FUMBLE_RESULT = 20;