Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

Commit

Permalink
Update BaleLoaderAIDriver.lua
Browse files Browse the repository at this point in the history
Fixes bale collector unloading at unload WP
  • Loading branch information
Tensuko committed Apr 12, 2021
1 parent 86cac08 commit 7c2e146
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion BaleLoaderAIDriver.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ end

function BaleLoaderAIDriver:start(startingPoint)
self:initializeBaleLoader()
self.unloadRefillState = nil
UnloadableFieldworkAIDriver.start(self, startingPoint)
end

Expand Down Expand Up @@ -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.')
Expand Down

0 comments on commit 7c2e146

Please sign in to comment.