From 29e414ddf141b0aa65e76555cb1c3d8b75c96dc4 Mon Sep 17 00:00:00 2001 From: Moka <54149968+MokaStitcher@users.noreply.github.com> Date: Sat, 2 Nov 2024 15:17:06 +0100 Subject: [PATCH] Apply suggestions from code review Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com> Co-authored-by: PigeonBar <56974298+PigeonBar@users.noreply.github.com> --- src/modifier/modifier-type.ts | 6 +++--- src/test/utils/mocks/mockTimedEventManager.ts | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/modifier/modifier-type.ts b/src/modifier/modifier-type.ts index 49c8e6f115b..dfa46ce3667 100644 --- a/src/modifier/modifier-type.ts +++ b/src/modifier/modifier-type.ts @@ -136,14 +136,14 @@ export class ModifierType { if (this.id === modifier.modifierType.id) { let weight: number; if (modifier.weight instanceof Function) { - weight = party ? (modifier.weight as Function)(party, rerollCount) : 0; + weight = party ? modifier.weight(party, rerollCount) : 0; } else { - weight = modifier.weight as number; + weight = modifier.weight; } if (weight > 0) { this.tier = modifier.modifierType.tier; return this; - } else if (!isNullOrUndefined(defaultTier)) { + } else if (isNullOrUndefined(defaultTier)) { // If weight is 0, keep track of the first tier where the item was found defaultTier = modifier.modifierType.tier; } diff --git a/src/test/utils/mocks/mockTimedEventManager.ts b/src/test/utils/mocks/mockTimedEventManager.ts index bba2bc05a16..b44729996a7 100644 --- a/src/test/utils/mocks/mockTimedEventManager.ts +++ b/src/test/utils/mocks/mockTimedEventManager.ts @@ -2,10 +2,6 @@ import { TimedEventManager } from "#app/timed-event-manager"; /** Mock TimedEventManager so that ongoing events don't impact tests */ export class MockTimedEventManager extends TimedEventManager { - constructor() { - super(); - } - override activeEvent() { return undefined; }