From 4db95e481f3229a8fb869f28ef59e6a843c05208 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Sat, 4 Dec 2021 19:40:22 -0500 Subject: [PATCH] move DetectModdedItems to api --- eid_api.lua | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/eid_api.lua b/eid_api.lua index 5659864d..b09e8904 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -777,14 +777,27 @@ function EID:GetMaxCollectibleID() step = step // 2 end end - + return id end local maxCollectibleID = nil +function EID:DetectModdedItems() + if maxCollectibleID == nil then + maxCollectibleID = EID:GetMaxCollectibleID() + end + if maxCollectibleID > EID.XMLMaxItemID then + return true + end + if EID.itemConfig:GetCollectible(EID.XMLMaxItemID) == nil then + return true + end + return false +end + function EID:isCollectibleUnlocked(collectibleID, itemPoolOfItem) local itemPool = Game():GetItemPool() - if (not maxCollectibleID) then maxCollectibleID = EID:GetMaxCollectibleID() end + if maxCollectibleID == nil then maxCollectibleID = EID:GetMaxCollectibleID() end for i= 1, maxCollectibleID do if ItemConfig.Config.IsValidCollectible(i) and i ~= collectibleID then itemPool:AddRoomBlacklist(i)