File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -181,6 +181,12 @@ API.functions["start_run"] = function(args)
181181end
182182
183183API .functions [" skip_or_select_blind" ] = function (args )
184+ -- Validate current game state is appropriate for blind selection
185+ if G .STATE ~= G .STATES .BLIND_SELECT then
186+ API .send_error_response (" Cannot skip or select blind when not in blind selection" , { current_state = G .STATE })
187+ return
188+ end
189+
184190 local current_blind = G .GAME .blind_on_deck
185191 local blind_obj = G .blind_select_opts [string.lower (current_blind )]
186192 if args .action == " select" then
@@ -220,6 +226,12 @@ API.functions["skip_or_select_blind"] = function(args)
220226end
221227
222228API .functions [" play_hand_or_discard" ] = function (args )
229+ -- Validate current game state is appropriate for playing hand or discarding
230+ if G .STATE ~= G .STATES .SELECTING_HAND then
231+ API .send_error_response (" Cannot play hand or discard when not selecting hand" , { current_state = G .STATE })
232+ return
233+ end
234+
223235 if args .action == " discard" and G .GAME .current_round .discards_left == 0 then
224236 API .send_error_response (
225237 " No discards left to perform discard" ,
You can’t perform that action at this time.
0 commit comments