Merge pull request #392 from Buurazu/master

Fix mods making REPENTANCE = false
This commit is contained in:
wofsauge authored and GitHub committed 2022-02-24 15:35:45 +01:00
commit 3982ee7a82
2 files changed
+6 -7

No files matched your search

+1 -7
View File
@@ -513,8 +513,7 @@ local moddedCrafting = false
-- Check for modded items past the known max item ID on game start (can also support game updates)
-- Only works if the new items are at Weight 1.0 in their item pools, but better than nothing
local function GameStartCrafting()
if EID.Config["BagOfCraftingModdedRecipes"] and not EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_TMTRAINER) and EID.itemConfig:GetCollectible(EID.XMLMaxItemID+1) ~= nil then
dofile(EID.modPath .. "eid_xmldata.lua")
if EID.Config["BagOfCraftingModdedRecipes"] and not EID:PlayersHaveCollectible(CollectibleType.COLLECTIBLE_TMTRAINER) and EID.itemConfig:GetCollectible(EID.XMLMaxItemID+1) ~= nil and not moddedCrafting then
-- Items past max ID detected
CraftingMaxItemID = EID.XMLMaxItemID -- XMLMaxItemID is never modified
-- Add new item qualities
@@ -540,11 +539,6 @@ local function GameStartCrafting()
end
moddedCrafting = true
sortNeeded = true
elseif moddedCrafting then
-- we had modded items; they have since been disabled
dofile(EID.modPath .. "eid_xmldata.lua")
moddedCrafting = false
sortNeeded = true
end
end
EID:AddCallback(ModCallbacks.MC_POST_GAME_STARTED, GameStartCrafting)
+5
View File
@@ -826,6 +826,11 @@ EID.RecheckVoid = false
function EID:onGameUpdate()
EID.GameUpdateCount = EID.GameUpdateCount + 1
EID:checkPlayersForMissingItems()
-- Fix some outdated mods erroneously setting the REPENTANCE constant to false
if EID.GameVersion == "rep" and REPENTANCE == false then
REPENTANCE = true
end
if collSpawned then
collSpawned = false