From 128a6a6214261181a5ab792318f380109dad0189 Mon Sep 17 00:00:00 2001 From: Buurazu Date: Sun, 21 Nov 2021 21:46:07 -0500 Subject: [PATCH] Fix crash on TMTRAINER + spindown dice --- eid_api.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/eid_api.lua b/eid_api.lua index 8e6ecd32..9dde15d3 100644 --- a/eid_api.lua +++ b/eid_api.lua @@ -756,10 +756,12 @@ end -- Converts a given CollectibleID into the respective Spindown dice result function EID:getSpindownResult(collectibleID) local newID = collectibleID + local attempts = 0 repeat newID = newID - 1 + attempts = attempts + 1 --note: the order of the SkipLocked check statement is important so that the item is checked for being in a pool either way (to display a ? if it isn't) - until (EID.itemConfig:GetCollectible(newID) and (EID:isCollectibleUnlockedAnyPool(newID) or not EID.Config["SpindownDiceSkipLocked"]) and not EID.itemConfig:GetCollectible(newID).Hidden) or newID == CollectibleType.COLLECTIBLE_NULL + until (EID.itemConfig:GetCollectible(newID) and (EID:isCollectibleUnlockedAnyPool(newID) or not EID.Config["SpindownDiceSkipLocked"]) and not EID.itemConfig:GetCollectible(newID).Hidden) or newID == CollectibleType.COLLECTIBLE_NULL or attempts > 10 return newID end