Skip to content

Commit

Permalink
Live Rankings: fixed 0 score on new rankings entry.
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMaximum committed Aug 30, 2023
1 parent 68b0f3c commit 3caddfd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyplanet/apps/contrib/live_rankings/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,8 @@ async def player_finish(self, player, race_time, lap_time, cps, flow, is_end_rac
if current_ranking is not None:
current_ranking['points_added'] = new_finish['points_added']
else:
new_finish['score'] = 0
self.current_rankings.append(new_finish)
new_ranking = dict(login=player.login, nickname=player.nickname, score=0, points_added=new_finish['points_added'])
self.current_rankings.append(new_ranking)

self.current_rankings.sort(key=lambda x: (-x['score'], -x['points_added']))
await self.widget.display()
Expand Down

0 comments on commit 3caddfd

Please sign in to comment.