Improved compatibility with AB+ and deactivated Achievement warning for that DLC

This commit is contained in:
Wofsauge committed 2021-10-22 20:03:05 +02:00
1 parent 1a22c0083d
commit 751df4c3bb
3 files changed
+8 -9

No files matched your search

+5 -6
View File
@@ -776,7 +776,6 @@ end
local maxCollectibleID = nil
function EID:isCollectibleUnlocked(collectibleID, itemPoolOfItem)
local itemPool = Game():GetItemPool()
--local itemConfig = Isaac.GetItemConfig()
if (not maxCollectibleID) then maxCollectibleID = EID:GetMaxCollectibleID() end
for i= 1, maxCollectibleID do
if ItemConfig.Config.IsValidCollectible(i) and i ~= collectibleID then
@@ -785,7 +784,7 @@ function EID:isCollectibleUnlocked(collectibleID, itemPoolOfItem)
end
local isUnlocked = false
for i = 0,1 do -- some samples to make sure
local collID = itemPool:GetCollectible(itemPoolOfItem, false)
local collID = itemPool:GetCollectible(itemPoolOfItem, false, 1)
if collID == collectibleID then
isUnlocked = true
break
@@ -799,18 +798,18 @@ function EID:isCollectibleUnlockedAnyPool(collectibleID)
local item = EID.itemConfig:GetCollectible(collectibleID)
if EID.itemUnlockStates[collectibleID] == nil then
--whitelist all quest items and items with no associated achievement
if (item.AchievementID == -1 or item.Tags & ItemConfig.TAG_QUEST == ItemConfig.TAG_QUEST) then
if item.AchievementID == -1 or (item.Tags and item.Tags & ItemConfig.TAG_QUEST == ItemConfig.TAG_QUEST) then
EID.itemUnlockStates[collectibleID] = true
return true
end
--blacklist all hidden items
if (item.Hidden) then
if item.Hidden then
EID.itemUnlockStates[collectibleID] = false
return false
end
--iterate through the pools this item can be in
for k,v in ipairs(EID.CollectiblesPools[collectibleID]) do
if (EID:isCollectibleUnlocked(collectibleID, v)) then
for k,itemPoolID in ipairs(EID.CollectiblesPools[collectibleID]) do
if (itemPoolID < ItemPoolType.NUM_ITEMPOOLS and EID:isCollectibleUnlocked(collectibleID, itemPoolID)) then
EID.itemUnlockStates[collectibleID] = true
return true
end