Adds fail check to bag of crafting to prevent calculations when modded items are enabled

This commit is contained in:
Wofsauge committed 2021-06-13 23:09:36 +02:00
1 parent fe7891aa74
commit d2bf2bc4b9
2 files changed
+32

No files matched your search

+31
View File
@@ -517,6 +517,34 @@ local function toggleControls(value)
end
end
local function GetMaxCollectibleID()
local id = CollectibleType.NUM_COLLECTIBLES-1
local step = 16
while step > 0 do
if Isaac.GetItemConfig():GetCollectible(id+step) ~= nil then
id = id + step
else
step = step // 2
end
end
return id
end
local maxItemID = nil
local function detectModdedItems()
if maxItemID == nil then
maxItemID = GetMaxCollectibleID()
end
if maxItemID > CollectibleType.NUM_COLLECTIBLES then
local customDescObj = EID:getDescriptionObj(5, 100, 710)
customDescObj.Description = EID.descriptions["en_us"].CraftingBagModError
EID:printDescription(customDescObj)
return true
end
return false
end
function EID:handleBagOfCraftingRendering()
trackBagHolding()
detectBagContentShift()
@@ -527,6 +555,9 @@ function EID:handleBagOfCraftingRendering()
if EID.Config["DisplayBagOfCrafting"] == "hold" and not string.find(EID.player:GetSprite():GetAnimation(), "PickupWalk") then
return false
end
if detectModdedItems() then
return false
end
local results = {}
local floorItems = {}