Fix no Flip items after fresh game reload

This commit is contained in:
Buurazu authored and GitHub committed 2022-01-26 01:14:35 -05:00
1 parent 5c433ad018
commit bba23bcc57
1 file changed
+14 -10
+14 -10
View File
@@ -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