Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
schwiti6190 committed Oct 17, 2023
1 parent 425d780 commit 4fcef26
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions scripts/silo/BunkerSiloVehicleController.lua
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,10 @@ end
function CpBunkerSiloLoaderController:isEndReached(node, margin)
if self.drivingTarget then
local dx, dz = unpack(self.drivingTarget[2])
local _, _, z = worldToLocal(node, dx, 0, dz)
return z < margin, MathUtil.clamp(z * 2, 5, math.huge)
local _, _, zOffset = localToLocal(node, AIUtil.getDirectionNode(self.vehicle), 0, 0, 0)
local _, _, z = worldToLocal(AIUtil.getDirectionNode(self.vehicle), dx, 0, dz)
self:debug("Silo/heap end offset %.1f", z-zOffset)
return z - zOffset < margin, MathUtil.clamp(z * 2, 5, math.huge)
end
return false, math.huge
end
Expand Down

0 comments on commit 4fcef26

Please sign in to comment.