From 1a67e49491cef4cc7e7209618017004f4e1be9a5 Mon Sep 17 00:00:00 2001 From: Diego Roversi Date: Sat, 23 May 2020 10:28:17 +0200 Subject: fix server crash --- bubbob/player.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'bubbob') diff --git a/bubbob/player.py b/bubbob/player.py index e4d99fe..0a67789 100644 --- a/bubbob/player.py +++ b/bubbob/player.py @@ -12,6 +12,8 @@ from mnstrmap import DigitsMisc KEEPALIVE = 5*60 # seconds CheatDontDie = 0 +def cmp(a, b): + return (a > b) - (a < b) class Dragon(ActiveSprite): priority = 1 @@ -1060,7 +1062,8 @@ def scoreboard(reset=0, inplace=0, compresslimittime=0): teamslist[1].sort() plist.append((teamspoints[0], None, teamslist[0])) plist.append((teamspoints[1], None, teamslist[1])) - plist.sort() + print(f"scoreboard: plist={plist}", file=sys.stderr) + plist.sort(key=lambda x: x[0]) # sort by teamspoints? x0 = boards.bwidth y0 = boards.bheight for score, p, t in plist: -- cgit v1.2.3