Skip to content

Commit

Permalink
fix pipe position for towed combines
Browse files Browse the repository at this point in the history
  • Loading branch information
Tensuko committed Sep 11, 2023
1 parent 5aa3363 commit 0366a34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion scripts/ai/AIDriveStrategyUnloadCombine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ function AIDriveStrategyUnloadCombine:driveBesideCombine()
local targetNode = self:getTrailersTargetNode()
local _, offsetZ = self:getPipeOffset(self.combineToUnload)
-- TODO: this - 1 is a workaround the fact that we use a simple P controller instead of a PI
local _, _, dz = localToLocal(targetNode, self:getCombineRootNode(), 0, 0, -offsetZ - 2)
local _, _, dz = localToLocal(targetNode, self.combineToUnload:getAIDirectionNode(), 0, 0, -offsetZ - 2)
-- use a factor to make sure we reach the pipe fast, but be more gentle while discharging
local factor = self.combineToUnload:getCpDriveStrategy():isDischarging() and 0.5 or 2
local speed = self.combineToUnload.lastSpeedReal * 3600 + MathUtil.clamp(-dz * factor, -10, 15)
Expand Down

0 comments on commit 0366a34

Please sign in to comment.