Skip to content
This repository was archived by the owner on Jul 8, 2023. It is now read-only.

Commit 0c9b8a9

Browse files
committed
Fix division by zero
1 parent 8212fa3 commit 0c9b8a9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

project/game/ai/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def estimate_weighted_mean_hand_value(self, discard_option):
220220
weighted_hand_cost += hand_cost.cost["main"] * discard_option.wait_to_ukeire[waiting]
221221
number_of_tiles += discard_option.wait_to_ukeire[waiting]
222222

223-
return int(weighted_hand_cost / number_of_tiles)
223+
return number_of_tiles and int(weighted_hand_cost / number_of_tiles) or 0
224224

225225
def should_call_riichi(self):
226226
return self.riichi.should_call_riichi()

0 commit comments

Comments
 (0)