Skip to content

Commit 17a785a

Browse files
authored
Fix bug with Washizu ending the game after one hand
Due to shenanigans, when the Tobi mod is not selected, `washizu.jq` creates a null `"tobi"` key, which previously caused this section of code to always end the game. Here, we replace the check with one that asks if the `"tobi"` key is a number.
1 parent 7eb5ec7 commit 17a785a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/riichi_advanced/game/game_state.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -953,7 +953,7 @@ defmodule RiichiAdvanced.GameState do
953953
state = case Rules.get(state.rules_ref, "score_calculation") do
954954
nil -> state
955955
score_calculation ->
956-
if Map.has_key?(score_calculation, "tobi") do
956+
if is_number(Map.get(score_calculation, "tobi")) do
957957
tobi = Map.get(score_calculation, "tobi", 0)
958958
if Enum.any?(state.players, fn {_seat, player} -> player.score < tobi end) do
959959
Map.put(state, :round_result, :end_game)

0 commit comments

Comments
 (0)