diff --git a/popn@asphyxia/handler/utils.ts b/popn@asphyxia/handler/utils.ts index 85b0e2e..d259907 100644 --- a/popn@asphyxia/handler/utils.ts +++ b/popn@asphyxia/handler/utils.ts @@ -212,7 +212,7 @@ const doConvert = async (profile: ProfileDoc): Promise> // Update scores let scoresData: Scores = { collection: 'scores', version: 'v25', scores: {} }; - const oldScores = await DB.Find(null, { collection: 'scores' }); + const oldScores = await DB.Find(profile.__refid, { collection: 'scores' }); for (const oldScore of oldScores) { for (const key in oldScore.scores) { scoresData.scores[key] = { @@ -234,9 +234,9 @@ const doConvert = async (profile: ProfileDoc): Promise> }[Math.max(oldScore.scores[key].clearmedal || 0, oldScore.scores[key].clear_type || 0)] }; } - await DB.Remove(oldScore.__refid, { collection: 'scores' }); - await DB.Insert(oldScore.__refid, scoresData); } + await DB.Remove(profile.__refid, { collection: 'scores' }); + await DB.Insert(profile.__refid, scoresData); return newProfile; } \ No newline at end of file