Fixed issue where loading old config files caused new config options to disappear

This commit is contained in:
wofsauge committed 2020-04-06 18:33:20 +02:00
1 parent b4dae6b71a
commit 740f8e06b3
2 files changed
+7 -3

No files matched your search

+6 -2
View File
@@ -316,7 +316,7 @@ local hideDescToggle= false
-- check if an entity is part of the describable entities
local function isEntityAllowed(entity)
local isAllowed = false
local isAllowed = false
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_COLLECTIBLE and EIDConfig["DisplayItemInfo"])
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_TRINKET and EIDConfig["DisplayTrinketInfo"])
isAllowed = isAllowed or (entity.Variant == PickupVariant.PICKUP_TAROTCARD and EIDConfig["DisplayCardInfo"])
@@ -469,7 +469,11 @@ local json = require("json")
function OnGameStart(isSave)
--Loading Moddata--
if EID:HasData() then
EIDConfig = json.decode(Isaac.LoadModData(EID))
savedEIDConfig = json.decode(Isaac.LoadModData(EID))
for key, value in pairs(EIDConfig) do
if savedEIDConfig[key]~=nil then EIDConfig[key]=savedEIDConfig[key] end
end
end
end
EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, OnGameStart)