From 7c2e1460a2a73d2c313498346062965c141d279f Mon Sep 17 00:00:00 2001 From: Tensuko Date: Mon, 12 Apr 2021 18:58:55 +0200 Subject: [PATCH] Update BaleLoaderAIDriver.lua Fixes bale collector unloading at unload WP --- BaleLoaderAIDriver.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BaleLoaderAIDriver.lua b/BaleLoaderAIDriver.lua index 6d76c682b..f313930ac 100644 --- a/BaleLoaderAIDriver.lua +++ b/BaleLoaderAIDriver.lua @@ -65,6 +65,7 @@ end function BaleLoaderAIDriver:start(startingPoint) self:initializeBaleLoader() + self.unloadRefillState = nil UnloadableFieldworkAIDriver.start(self, startingPoint) end @@ -115,7 +116,7 @@ function BaleLoaderAIDriver:driveUnloadOrRefill(dt) elseif self:haveBales() and self.unloadRefillState == self.states.APPROACHING_UNLOAD_POINT then local unloadNode = self:getUnloadNode(nearUnloadPoint, unloadPointIx) - local _, _, dz = localToLocal(unloadNode, self.baleLoader.cp.realUnloadOrFillNode, 0, 0, 0) + dz = calcDistanceFrom(unloadNode, self.baleLoader.cp.realUnloadOrFillNode) self:debugSparse('distance to unload point: %.1f', dz) if math.abs(dz) < 1 or self:tooCloseToOtherBales() then self:debug('Unload point reached.')