File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -2057,7 +2057,10 @@ defmodule RiichiAdvanced.GameState do
20572057 |> Map . put ( :calculate_closest_american_hands_pid , nil )
20582058
20592059 # some conditions (namely "is_tenpai_american") might have changed based on closest american hands, so recalculate buttons
2060- state = Buttons . recalculate_buttons ( state )
2060+ # of course, only calculate this if the match has started
2061+ state = if Enum . all? ( state . players , fn { _seat , player } -> "match_start" not in player . status end ) do
2062+ Buttons . recalculate_buttons ( state )
2063+ else state end
20612064 # note that this races the AI: the AI might act before closest_american_hands is calculated, so they may miss buttons that should be there
20622065 # TODO maybe fix this by pausing the game at the start of this particular async calculation, and unpausing after
20632066 state = broadcast_state_change ( state , false )
You can’t perform that action at this time.
0 commit comments