Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion scripts/ai/strategies/AIDriveStrategyUnloadCombine.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,12 @@ end
function AIDriveStrategyUnloadCombine:isLinedUpWithPipe(dx, dz, pipeOffset, debugEnabled)
-- allow more offset when further away from the pipe, this is +- 50 cm at the pipe and grows
-- 25 cm with every meter, which is about 30 degrees (15 left and 15 right)
local tolerance = 0.25 + 0.5 * math.abs(dz)
local tolerance = 0.55 + 0.5 * math.abs(dz)
local combineSpeed = self.combineToUnload.lastSpeedReal * 3600
if combineSpeed > 6 then
-- when the combine is moving, we can be more tolerant as we'll have a lot more space to align
tolerance = 2 * tolerance
end
self:debugIf(debugEnabled, 'isLinedUpWithPipe: dx > pipe offset +- tolerance (%.1f > %.1f +- %.1f) at dz: %.1f',
dx, pipeOffset, tolerance, dz)
return dx > pipeOffset - tolerance and dx < pipeOffset + tolerance
Expand Down
Loading