From aade574a4330f0551cc4615140b39de48c402132 Mon Sep 17 00:00:00 2001 From: kittenchilly Date: Tue, 26 Apr 2022 13:02:12 -0500 Subject: [PATCH] Better Death Certificate room detection --- eid_api.lua | 13 +++++++++++++ main.lua | 5 +---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/eid_api.lua b/eid_api.lua index d03bf1da..0e759732 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -1229,6 +1229,19 @@ function EID:AreAchievementsAllowed() return true end +function EID:IsDeathCertificateRoom() + local level = game:GetLevel() + local roomData = level:GetRoomByIdx(level:GetCurrentRoomIndex()).Data + if roomData then + if roomData.StageID == 35 then -- Home + if roomData.SubType == 33 or roomData.SubType == 34 then -- Death Certificate room subtypes + return true + end + end + end + return false +end + -- Converts a given table into a string containing the crafting icons of the table -- Example input: {1,2,3,4,5,6,7,8} -- Result: "{{Crafting1}}{{Crafting2}}{{Crafting3}}{{Crafting4}}{{Crafting5}}{{Crafting6}}{{Crafting7}}{{Crafting8}}" diff --git a/main.lua b/main.lua index 04ad2e72..0001d117 100644 --- a/main.lua +++ b/main.lua @@ -740,10 +740,7 @@ if REPENTANCE then 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))) + isDeathCertRoom = EID:IsDeathCertificateRoom() -- Handle Flip Item initialItemNext = false