From bba23bcc5736417ac850a42d930baa28a485583b Mon Sep 17 00:00:00 2001 From: Buurazu Date: Wed, 26 Jan 2022 01:14:35 -0500 Subject: [PATCH] Fix no Flip items after fresh game reload --- main.lua | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/main.lua b/main.lua index 8d8d6108..d3fb188e 100644 --- a/main.lua +++ b/main.lua @@ -628,16 +628,7 @@ end local isMirrorRoom = false local isDeathCertRoom = false if REPENTANCE then - function EID:onNewRoom() - isMirrorRoom = game:GetLevel():GetCurrentRoom():IsMirrorWorld() - - local level = game:GetLevel() - local id = level:GetCurrentRoomIndex() - isDeathCertRoom = (id >=0 and GetPtrHash(level:GetRoomByIdx(id)) == GetPtrHash(level:GetRoomByIdx(id, 2))) - - -- Handle Flip Item - initialItemNext = false - flipItemNext = false + function EID:AssignFlipItems() EID.flipMaxIndex = -1 local curRoomIndex = game:GetLevel():GetCurrentRoomIndex() if EID.flipItemPositions[curRoomIndex] then @@ -651,6 +642,18 @@ if REPENTANCE then end end end + function EID:onNewRoom() + isMirrorRoom = game:GetLevel():GetCurrentRoom():IsMirrorWorld() + + local level = game:GetLevel() + local id = level:GetCurrentRoomIndex() + isDeathCertRoom = (id >=0 and GetPtrHash(level:GetRoomByIdx(id)) == GetPtrHash(level:GetRoomByIdx(id, 2))) + + -- Handle Flip Item + initialItemNext = false + flipItemNext = false + EID:AssignFlipItems() + end EID:AddCallback(ModCallbacks.MC_POST_NEW_ROOM, EID.onNewRoom) end --------------------------------------------------------------------------- @@ -1279,6 +1282,7 @@ if EID.MCMLoaded or REPENTANCE then for k, _ in pairs(configIgnoreList) do savedEIDConfig[k] = nil end + EID:AssignFlipItems() end end