diff --git a/typescript/server/src/game-implementations/games/ddr.ts b/typescript/server/src/game-implementations/games/ddr.ts index 50020ce65..652df3684 100644 --- a/typescript/server/src/game-implementations/games/ddr.ts +++ b/typescript/server/src/game-implementations/games/ddr.ts @@ -342,6 +342,24 @@ export const DDR_IMPL: GameImplementation = { base.scoreData.optional.exScore = score.scoreData.optional.exScore; }, ), + CreatePBMergeFor( + "largest", + { + type: "REGULAR", + metric: "flare", + }, + "Best Flare", + (base, score) => { + base.scoreData.optional.flare = + score.scoreData.lamp !== "FAILED" + ? score.scoreData.optional.flare + : base.scoreData.optional.flare; + base.calculatedData.flareSkill = + score.scoreData.lamp !== "FAILED" + ? score.calculatedData.flareSkill + : base.calculatedData.flareSkill; + }, + ), ], sessionCalcs: (arr) => ({ flareSkill: SessionAvgBest10For("flareSkill")(arr), diff --git a/typescript/server/src/lib/score-import/framework/score-importing/derivers.ts b/typescript/server/src/lib/score-import/framework/score-importing/derivers.ts index de7659c92..9ecdced72 100644 --- a/typescript/server/src/lib/score-import/framework/score-importing/derivers.ts +++ b/typescript/server/src/lib/score-import/framework/score-importing/derivers.ts @@ -60,10 +60,7 @@ export function CreateEnumIndexes(game: TGame, metrics: an indexes[key] = index; } - for (const [key, conf] of [ - ...Object.entries(gameConfig.providedMetrics), - ...Object.entries(gameConfig.derivedMetrics), - ]) { + for (const [key, conf] of Object.entries(gameConfig.optionalMetrics)) { if (conf.type !== "ENUM") { continue; } @@ -86,7 +83,7 @@ export function CreateEnumIndexes(game: TGame, metrics: an ); } - indexes[key] = index; + optionalIndexes[key] = index; } return {