move DetectModdedItems to api

This commit is contained in:
Buurazu authored and GitHub committed 2021-12-04 19:40:22 -05:00
1 parent 14807d51b0
commit 4db95e481f
1 file changed
+15 -2
+15 -2
View File
@@ -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)