WebSocket debugger: Any savestate slot in headless

game.state.save and game.state.load with a slot were limited to the
app's slot count (5 by default), which only means how many the UI shows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Henrik RydgårdandClaude Opus 5.5 committed 2026-10-29 00:20:14 +01:00
1 parent b719c7e027
commit df72f3be81
2 files changed
+3 -2

No files matched your search

+2 -1
View File
@@ -115,7 +115,8 @@ void WebSocketGameState::StateOperation(DebuggerRequest &req, StateOp op) {
if (useSlot) {
if (!req.ParamU32("slot", &slot))
return;
if (slot >= (uint32_t)g_Config.iSaveStateSlotCount)
// The slot count is how many the app's UI shows. Headless has no UI to show them in.
if (slot >= (uint32_t)g_Config.iSaveStateSlotCount && !System_GetPropertyBool(SYSPROP_IS_HEADLESS))
return req.Fail("Invalid slot");
} else if ((op == StateOp::LOAD || op == StateOp::SAVE) && !req.ParamString("path", &path)) {
return;