Reset the itemunlockstates table on game exit

This commit is contained in:
Buurazu authored and GitHub committed 2022-12-09 01:57:24 -05:00
1 parent 120a3c4afb
commit c2e093988d
1 file changed
+5 -4
+5 -4
View File
@@ -32,6 +32,7 @@ EID.lastDescriptionEntity = nil
EID.lineHeight = 11 EID.lineHeight = 11
EID.itemConfig = Isaac.GetItemConfig() EID.itemConfig = Isaac.GetItemConfig()
EID.itemUnlockStates = {} EID.itemUnlockStates = {}
EID.itemAvailableStates = {}
EID.CraneItemType = {} EID.CraneItemType = {}
EID.absorbedItems = {} EID.absorbedItems = {}
EID.CollectedItems = {} EID.CollectedItems = {}
@@ -1072,8 +1073,8 @@ local hasShownStartWarning = false
local function checkStartOfRunWarnings() local function checkStartOfRunWarnings()
if REPENTANCE and not EID.Config["DisableStartOfRunWarnings"] and game:GetFrameCount() < 10*30 then if REPENTANCE and not EID.Config["DisableStartOfRunWarnings"] and game:GetFrameCount() < 10*30 then
-- Old Repentance version check; update this to check for the existence of the newest mod API function EID uses -- Old Repentance version check; update this to check for the existence of the newest mod API function EID uses
-- 1.7.9b (Dec. 08, 2022): The IsAvailable function was added -- 1.7.9b (Dec. 08, 2022): The IsAvailable function was added (checking for Isaac.RunCallback existing instead)
if Isaac.GetItemConfig():GetCollectible(1).IsAvailable == nil then if Isaac.RunCallback == nil then
local demoDescObj = EID:getDescriptionObj(-999, -1, 1) local demoDescObj = EID:getDescriptionObj(-999, -1, 1)
demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or "" demoDescObj.Name = EID:getDescriptionEntry("AchievementWarningTitle") or ""
demoDescObj.Description = EID:getDescriptionEntry("OldGameVersionWarningText") or "" demoDescObj.Description = EID:getDescriptionEntry("OldGameVersionWarningText") or ""
@@ -1730,8 +1731,8 @@ function EID:OnGameExit()
EID.SaveData(EID, json.encode(EID.Config)) EID.SaveData(EID, json.encode(EID.Config))
EID:hidePermanentText() EID:hidePermanentText()
EID.itemUnlockStates[CollectibleType.COLLECTIBLE_CUBE_OF_MEAT] = nil EID.itemUnlockStates = {}
EID.itemUnlockStates[CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS] = nil EID.itemAvailableStates = {}
end end
EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, EID.OnGameExit) EID:AddCallback(ModCallbacks.MC_PRE_GAME_EXIT, EID.OnGameExit)