Fixed incompatibility with mods changing "NUM_COLLECTIBLES" enum value
This commit is contained in:
1 parent
7627162db8
commit
68615370f6
1 file changed
+3
-2
+3
-2
@@ -3,11 +3,12 @@ if not REPENTOGON then
|
|||||||
end
|
end
|
||||||
---@diagnostic disable: duplicate-set-field
|
---@diagnostic disable: duplicate-set-field
|
||||||
local game = Game()
|
local game = Game()
|
||||||
|
local maxVanillaItemID = CollectibleType.NUM_COLLECTIBLES -- sanity backup
|
||||||
|
|
||||||
-- REPENTOGON: Use PersistentGameData to determine item collection status
|
-- REPENTOGON: Use PersistentGameData to determine item collection status
|
||||||
-- Returns true if an item needs to be collected for the collection page
|
-- Returns true if an item needs to be collected for the collection page
|
||||||
function EID:requiredForCollectionPage(itemID)
|
function EID:requiredForCollectionPage(itemID)
|
||||||
if itemID >= CollectibleType.NUM_COLLECTIBLES or game:GetVictoryLap() > 0 or game:GetSeeds():IsCustomRun() then return false end
|
if itemID >= maxVanillaItemID or game:GetVictoryLap() > 0 or game:GetSeeds():IsCustomRun() then return false end
|
||||||
return not Isaac.GetPersistentGameData():IsItemInCollection(itemID)
|
return not Isaac.GetPersistentGameData():IsItemInCollection(itemID)
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -71,7 +72,7 @@ function EID:OnMenuRender()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
local demoDescObj = EID:getDescriptionObj(5, 100, CollectibleId, nil, false)
|
local demoDescObj = EID:getDescriptionObj(5, 100, CollectibleId, nil, false)
|
||||||
if CollectibleId < CollectibleType.NUM_COLLECTIBLES and not Isaac.GetPersistentGameData():IsItemInCollection(CollectibleId) then
|
if CollectibleId < maxVanillaItemID and not Isaac.GetPersistentGameData():IsItemInCollection(CollectibleId) then
|
||||||
EID:renderQuestionMark(nil)
|
EID:renderQuestionMark(nil)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in new issue
Block a user