mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Ban freeze-frame in hardcore mode, and tell the user when a savestate is refused
Freeze-frame restores a savestate every frame, straight through SaveState::LoadFromRam(), so it never touched the operation queue and neither hardcore check saw it. Blocked at the toggle in the dev menu, and again in the render loop, since hardcore mode can come up after the fact once the game has been identified. Enqueue also just dropped operations silently, so a load that arrived through a path with no check of its own (--state, auto-load) did nothing with no explanation. Both it and Process now go through WarnUserIfHardcoreModeActive, which is the same predicate plus the standard message. Callers that already ask it themselves return before reaching Enqueue, so nothing shows the message twice. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GgACRqkQNpfJQ4fjwyoEup
This commit is contained in:
1 parent
255896e89f
commit
be834b4446
3 files changed
+22
-14
No files matched your search
+9
-12
@@ -196,17 +196,15 @@ int g_screenshotFailures;
|
||||
pspFileSystem.DoState(p);
|
||||
}
|
||||
|
||||
// Hardcore mode bans loading savestates outright, and saving too unless the user opted
|
||||
// back into that.
|
||||
bool BannedInHardcoreMode(OperationType type) {
|
||||
if (!Achievements::HardcoreModeActive()) {
|
||||
return false;
|
||||
}
|
||||
return !(g_Config.bAchievementsSaveStateInHardcoreMode && type == OperationType::Save);
|
||||
}
|
||||
|
||||
void Enqueue(const SaveState::Operation &op) {
|
||||
if (!NetworkAllowSaveState() || BannedInHardcoreMode(op.type)) {
|
||||
if (!NetworkAllowSaveState()) {
|
||||
return;
|
||||
}
|
||||
// Hardcore mode bans loading savestates outright, and saving too unless the user opted
|
||||
// back into that. Callers that ask WarnUserIfHardcoreModeActive themselves never get
|
||||
// this far, so there's no double message - this is for the paths that go straight to
|
||||
// the queue, like --state and auto-load.
|
||||
if (Achievements::WarnUserIfHardcoreModeActive(op.type == OperationType::Save)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -816,9 +814,8 @@ int g_screenshotFailures;
|
||||
// read as active yet. An operation queued in that window (a hotkey press, --state,
|
||||
// auto-load) passed the check in Enqueue and would otherwise be applied here, after
|
||||
// identification has finished and hardcore mode has come up.
|
||||
if (BannedInHardcoreMode(op.type)) {
|
||||
if (Achievements::WarnUserIfHardcoreModeActive(op.type == OperationType::Save)) {
|
||||
WARN_LOG(Log::SaveState, "Dropping queued savestate operation - hardcore mode is active");
|
||||
Achievements::WarnUserIfHardcoreModeActive(op.type == OperationType::Save);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user