improved turtle defrag
This commit is contained in:
parent
c9e0ceef32
commit
ce0e89f5b3
@ -128,7 +128,7 @@ class InvManager {
|
|||||||
var topIndex = slots.length - 1;
|
var topIndex = slots.length - 1;
|
||||||
|
|
||||||
for (k => slot in slots) {
|
for (k => slot in slots) {
|
||||||
if (topIndex <= k) {
|
if (topIndex < k) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,8 +138,11 @@ class InvManager {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (true) {
|
var loopProtect = 20;
|
||||||
if (topIndex <= k) {
|
|
||||||
|
while (loopProtect > 0) {
|
||||||
|
loopProtect--;
|
||||||
|
if (topIndex < k) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user