fixed invManager wrong invState update
thanks chatGPT
This commit is contained in:
@@ -142,6 +142,7 @@ class InvManager {
|
||||
|
||||
while (loopProtect > 0) {
|
||||
loopProtect--;
|
||||
|
||||
if (topIndex < k) {
|
||||
return;
|
||||
}
|
||||
@@ -159,10 +160,9 @@ class InvManager {
|
||||
Log.error("Failed to transfer items");
|
||||
}
|
||||
|
||||
// Update invState
|
||||
var topState = invState.get(slots[topIndex]);
|
||||
topState.count += transferCount;
|
||||
invState.set(topIndex, topState);
|
||||
invState.set(slots[topIndex], topState);
|
||||
|
||||
var botState = invState.get(slot);
|
||||
botState.count -= transferCount;
|
||||
@@ -174,6 +174,10 @@ class InvManager {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (loopProtect < 0) {
|
||||
Log.silly("Loopprotection triggerd");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user