aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch')
-rw-r--r--games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch32
1 files changed, 32 insertions, 0 deletions
diff --git a/games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch b/games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch
index 62ec68e76..0fd0de1e8 100644
--- a/games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch
+++ b/games-board/rmahjong/files/rmahjong-0.4_fix_python3_compat.patch
@@ -1,3 +1,35 @@
+diff --git a/client/client.py b/client/client.py
+--- a/client/client.py
++++ b/client/client.py
+@@ -138,10 +138,10 @@ class Mahjong:
+
+ def init_player_boxes(self, names, player_winds, score):
+ self.player_boxes = [
+- PlayerBox((50, 700), names[0], player_winds[0], int(score[0]), direction_up, (0,-80)),
+- PlayerBox((954, 50), names[1], player_winds[1], int(score[1]), direction_left, (-210, 0)),
+- PlayerBox((700, 0), names[2], player_winds[2], int(score[2]), direction_up, (0,80)),
+- PlayerBox((0, 50), names[3], player_winds[3], int(score[3]), direction_right, (80,0)) ]
++ PlayerBox((50, 700), names[0], player_winds[0], int(float(score[0])), direction_up, (0,-80)),
++ PlayerBox((954, 50), names[1], player_winds[1], int(float(score[1])), direction_left, (-210, 0)),
++ PlayerBox((700, 0), names[2], player_winds[2], int(float(score[2])), direction_up, (0,80)),
++ PlayerBox((0, 50), names[3], player_winds[3], int(float(score[3])), direction_right, (80,0)) ]
+ for widget in self.player_boxes:
+ self.gui.add_widget(widget)
+
+diff --git a/client/states.py b/client/states.py
+--- a/client/states.py
++++ b/client/states.py
+@@ -555,8 +555,8 @@ class ScoreState(RoundPreparingState):
+ results = []
+ for wind in winds:
+ name = (self.mahjong.get_player_name(wind))
+- score = (int(self.message[wind + "_score"]))
+- payment = (int(self.message[wind + "_payment"]))
++ score = (int(float(self.message[wind + "_score"])))
++ payment = (int(float(self.message[wind + "_payment"])))
+ results.append((name, score, payment))
+ results.sort(key = lambda r: r[1], reverse = True)
+ return results
diff --git a/client/tilepainter.py b/client/tilepainter.py
--- a/client/tilepainter.py
+++ b/client/tilepainter.py