Made achievement checking function a bit less error prone

This commit is contained in:
Wofsauge committed 2021-10-31 00:45:06 +02:00
1 parent 80a51717ab
commit e9e9751913
1 file changed
+3
+3
View File
@@ -538,6 +538,8 @@ EID:AddCallback(ModCallbacks.MC_POST_UPDATE, EID.onGameUpdate)
local hasShownAchievementWarning = false
local function renderAchievementInfo()
if REPENTANCE and game:GetFrameCount() < 10*30 then
local hasBookOfRevelationsUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_BOOK_OF_REVELATIONS or CollectibleType.COLLECTIBLE_BOOK_REVELATIONS)
if not hasBookOfRevelationsUnlocked then
local hasCubeOfMeatUnlocked = EID:isCollectibleUnlockedAnyPool(CollectibleType.COLLECTIBLE_CUBE_OF_MEAT)
if not hasCubeOfMeatUnlocked then
local demoDescObj = EID:getDescriptionObj(-999, -1, 1)
@@ -546,6 +548,7 @@ local function renderAchievementInfo()
EID:displayPermanentText(demoDescObj)
hasShownAchievementWarning = true
end
end
elseif hasShownAchievementWarning then
EID:hidePermanentText()
end