diff --git a/server/src/game-implementations/games/ddr.ts b/server/src/game-implementations/games/ddr.ts index 96b0e3634..0f583b6d8 100644 --- a/server/src/game-implementations/games/ddr.ts +++ b/server/src/game-implementations/games/ddr.ts @@ -1,10 +1,4 @@ -import { - GoalFmtPercent, - GoalFmtScore, - GoalOutOfFmtPercent, - GoalOutOfFmtScore, - GradeGoalFormatter, -} from "./_common"; +import { GoalFmtScore, GoalOutOfFmtScore, GradeGoalFormatter } from "./_common"; import db from "../../external/mongo/db"; import { IsNullish } from "../../utils/misc"; import { CreatePBMergeFor } from "../utils/pb-merge"; @@ -260,6 +254,16 @@ export const DDR_IMPL: GPTServerImplementation<"ddr:DP" | "ddr:SP"> = { base.scoreData.score = score.scoreData.score; base.scoreData.grade = score.scoreData.grade; }), + CreatePBMergeFor("largest", "optional.enumIndexes.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; + }), ], profileCalcs: { flareSkill: async (game: Game, playtype: Playtype, userID: integer) => { diff --git a/server/src/lib/score-import/framework/score-importing/derivers.ts b/server/src/lib/score-import/framework/score-importing/derivers.ts index ff295c6c5..a324cd23b 100644 --- a/server/src/lib/score-import/framework/score-importing/derivers.ts +++ b/server/src/lib/score-import/framework/score-importing/derivers.ts @@ -77,10 +77,7 @@ export function CreateEnumIndexes(gpt: GPT, metrics: any, indexes[key] = index; } - for (const [key, conf] of [ - ...Object.entries(gptConfig.providedMetrics), - ...Object.entries(gptConfig.derivedMetrics), - ]) { + for (const [key, conf] of [...Object.entries(gptConfig.optionalMetrics)]) { if (conf.type !== "ENUM") { continue; } @@ -103,7 +100,7 @@ export function CreateEnumIndexes(gpt: GPT, metrics: any, ); } - indexes[key] = index; + optionalIndexes[key] = index; } return {