Skip to content

Commit b4b8958

Browse files
charc0alRDIL
andcommitted
Update components/scoreHandler.ts
Co-Authored-By: Reece Dunham <me@rdil.rocks>
1 parent 650fef3 commit b4b8958

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

components/scoreHandler.ts

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -886,17 +886,12 @@ export async function getMissionEndData(
886886
const userProgressionLocations = userData.Extensions.progression.Locations
887887

888888
if (!query.masteryUnlockableId) {
889-
if (userProgressionLocations[locationParentId]) {
890-
userProgressionLocations[locationParentId].PreviouslySeenXp = newLocationXp
891-
} else {
892-
log(LogLevel.WARN, `Location progression missing for ${locationParentId}, adding default progression.`)
893-
const defaultProgression: ProgressionData = {
894-
Xp: 0,
895-
Level: 1,
896-
PreviouslySeenXp: newLocationXp
897-
}
898-
userProgressionLocations[locationParentId] = defaultProgression
889+
userProgressionLocations[locationParentId] ??= {
890+
Xp: 0,
891+
Level: 1,
892+
PreviouslySeenXp: newLocationXp
899893
}
894+
userProgressionLocations[locationParentId].PreviouslySeenXp = newLocationXp
900895
}
901896

902897
if (!isDryRun) writeUserData(jwt.unique_name, gameVersion)

0 commit comments

Comments
 (0)