Adds a canary byte check before sending game completion (#3217)

This commit is contained in:
digiholic 2024-05-07 01:22:11 -06:00 committed by GitHub
parent 0ac8844f6f
commit 12b8fef1aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -110,6 +110,11 @@ local IsItemable = function()
end
local is_game_complete = function()
-- If the Cannary Byte is 0xFF, then the save RAM is untrustworthy
if memory.read_u8(canary_byte) == 0xFF then
return game_complete
end
-- If on the title screen don't read RAM, RAM can't be trusted yet
if IsOnTitle() then return game_complete end