mirror of
https://github.com/boykopovar/AnyPS5.git
synced 2026-10-30 12:25:49 +00:00
sceNpTrophyUnlockTrophy inserted the id into the in-memory set and then saved the state file. A save that threw (the state directory or the rename failed) left the trophy unlocked in memory but not on disk, so a retry answered TROPHY_ALREADY_UNLOCKED and the unlock was lost at the next start. The new set is now built on a copy, written, and only then installed. SaveState also never looked at the stream after writing, so a failed write (for example a full disk) was ignored and the truncated temporary file was renamed over the good state file. It now flushes, checks the stream, removes the partial temporary file and throws.