diff --git a/src/lib/turtle/InvManager.hx b/src/lib/turtle/InvManager.hx index 4fb55c9..84e29ca 100644 --- a/src/lib/turtle/InvManager.hx +++ b/src/lib/turtle/InvManager.hx @@ -128,7 +128,7 @@ class InvManager { var topIndex = slots.length - 1; for (k => slot in slots) { - if (topIndex <= k) { + if (topIndex < k) { return; } @@ -138,8 +138,11 @@ class InvManager { return; } - while (true) { - if (topIndex <= k) { + var loopProtect = 20; + + while (loopProtect > 0) { + loopProtect--; + if (topIndex < k) { return; }