Skip to content

Commit

Permalink
fix total score calc
Browse files Browse the repository at this point in the history
  • Loading branch information
cmyui committed May 30, 2024
1 parent a07006b commit 2b4caf1
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions common/speedrunning.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,17 +155,19 @@ async def get_active_speedrun_score(user_id: int, game_mode: int) -> int | None:
FROM scores
JOIN users ON scores.userid = users.id
JOIN beatmaps ON scores.beatmap_md5 = beatmaps.beatmap_md5
WHERE scores.time BETWEEN %s AND %s
AND scores.completed = 3
WHERE scores.userid = %s
AND scores.play_mode = %s
AND scores.time BETWEEN %s AND %s
AND scores.completed = 3
AND users.privileges & 1
AND beatmaps.ranked IN (2, 3)
ORDER BY {score_read_param} DESC
""",
[
user_id,
game_mode,
speedrun_starts_at.timestamp(),
speedrun_ends_at.timestamp(),
game_mode,
],
)
if speedrun.score_type is ScoreType.WEIGHTED_PP:
Expand Down

0 comments on commit 2b4caf1

Please sign in to comment.