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>
This commit is contained in:
Moka 2024-11-02 15:17:06 +01:00 committed by GitHub
parent 0bf1b8adbe
commit 29e414ddf1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 7 deletions

View File

@ -136,14 +136,14 @@ export class ModifierType {
if (this.id === modifier.modifierType.id) { if (this.id === modifier.modifierType.id) {
let weight: number; let weight: number;
if (modifier.weight instanceof Function) { if (modifier.weight instanceof Function) {
weight = party ? (modifier.weight as Function)(party, rerollCount) : 0; weight = party ? modifier.weight(party, rerollCount) : 0;
} else { } else {
weight = modifier.weight as number; weight = modifier.weight;
} }
if (weight > 0) { if (weight > 0) {
this.tier = modifier.modifierType.tier; this.tier = modifier.modifierType.tier;
return this; 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 // If weight is 0, keep track of the first tier where the item was found
defaultTier = modifier.modifierType.tier; defaultTier = modifier.modifierType.tier;
} }

View File

@ -2,10 +2,6 @@ import { TimedEventManager } from "#app/timed-event-manager";
/** Mock TimedEventManager so that ongoing events don't impact tests */ /** Mock TimedEventManager so that ongoing events don't impact tests */
export class MockTimedEventManager extends TimedEventManager { export class MockTimedEventManager extends TimedEventManager {
constructor() {
super();
}
override activeEvent() { override activeEvent() {
return undefined; return undefined;
} }