From c9e0ceef32ff8171b7d84766d7ed86aa982ad939 Mon Sep 17 00:00:00 2001 From: Niklas Kapelle Date: Sun, 28 Jan 2024 15:46:37 +0100 Subject: [PATCH] fixed turtle defrag --- src/lib/turtle/InvManager.hx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/lib/turtle/InvManager.hx b/src/lib/turtle/InvManager.hx index 582dd0c..4fb55c9 100644 --- a/src/lib/turtle/InvManager.hx +++ b/src/lib/turtle/InvManager.hx @@ -165,7 +165,9 @@ class InvManager { botState.count -= transferCount; invState.set(slot, botState); - if (count - transferCount <= 0) { + count -= transferCount; + + if (count <= 0) { break; } }