improved turtle defrag
This commit is contained in:
parent
c9e0ceef32
commit
ce0e89f5b3
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user