mirror of
https://github.com/bryanthaboi/gen1recomp
synced 2026-10-08 09:42:55 -04:00
CLOSES #604, CLOSES #666, CLOSES #716, CLOSES #727, CLOSES #763, CLOSES #781, CLOSES #784, CLOSES #799, CLOSES #801, CLOSES #810, CLOSES #828, CLOSES #834, CLOSES #838, CLOSES #849, CLOSES #852, CLOSES #857, CLOSES #863, CLOSES #864, CLOSES #867, CLOSES #869, CLOSES #870, CLOSES #872, CLOSES #839
This commit is contained in:
@@ -417,6 +417,18 @@ function SaveData.saveOptions(opts, fs)
|
||||
#encoded, type(wrote) == "string" and tostring(#wrote) or "nothing")
|
||||
return nil
|
||||
end
|
||||
-- #828: roll the backup FORWARD to the bytes just verified. The
|
||||
-- pre-write roll above only preserves the previous file for a death
|
||||
-- during this rewrite; at rest the backup must hold the newest verified
|
||||
-- state, because the hard teardown out of a game session (HostShell's
|
||||
-- restartApp kill on Android, execv on a SteamOS AppImage) can eat the
|
||||
-- main file outright and loadOptions then promotes this copy. The
|
||||
-- encoder is key-sorted, so the follow-up rewrites a play session makes
|
||||
-- (play()'s lastVersion stamp, the in-game save flush) are byte-identical
|
||||
-- and skip the conditional roll -- without this line the backup still
|
||||
-- held the file from BEFORE the launcher's change, and recovery reverted
|
||||
-- the just-changed setting (BATTLE LAYOUT back to OG).
|
||||
fs.write(OPTIONS_BACKUP_FILENAME, encoded)
|
||||
-- the staged witness has served its purpose; the main file is verified
|
||||
remove(fs, OPTIONS_TMP_FILENAME)
|
||||
return opts
|
||||
|
||||
Reference in New Issue
Block a user