Skip to content

Commit

Permalink
Release 1.0.6.9
Browse files Browse the repository at this point in the history
Chase combine will no longer stop right away if unload fill level is reached.
Trailer cover is now open for waiting unloaders.
  • Loading branch information
Stephan-S committed Nov 17, 2019
1 parent f165ad4 commit 7b5e6f1
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 10 deletions.
Binary file added FS19_AutoDrive/FS19_AutoDrive.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion FS19_AutoDrive/modDesc.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Créer, ajouter, modifier, supprimer vos routes ou points de destination à l'ai
]]>
</ru>
</description>
<version>1.0.6.8</version>
<version>1.0.6.9</version>
<multiplayer supported="true"/>
<iconFilename>store.dds</iconFilename>
<extraSourceFiles>
Expand Down
2 changes: 1 addition & 1 deletion FS19_AutoDrive/scripts/AutoDrive.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AutoDrive = {}
AutoDrive.Version = "1.0.6.8-14"
AutoDrive.Version = "1.0.6.9"
AutoDrive.configChanged = false
AutoDrive.handledRecalculation = true

Expand Down
2 changes: 1 addition & 1 deletion FS19_AutoDrive/scripts/AutoDriveCombineMode.lua
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ function AutoDrive:checkForChaseModeStopCondition(vehicle, dt)
vehicle.ad.ccMode = AutoDrive.CC_MODE_WAITING_FOR_COMBINE_TO_TURN
end

if vehicle.ccInfos.trailerFillLevel >= ((AutoDrive.getSetting("unloadFillLevel", vehicle)) - 0.001) then
if vehicle.ccInfos.trailerFillLevel >= ((AutoDrive.getSetting("unloadFillLevel", vehicle)) - 0.001) and (not (vehicle.ad.ccMode == AutoDrive.CC_MODE_CHASING)) then
vehicle.ad.combineState = AutoDrive.DRIVE_TO_START_POS
AutoDrivePathFinder:startPathPlanningToStartPosition(vehicle, vehicle.ad.currentCombine)
AutoDrive:unregisterDriverAsUnloader(vehicle)
Expand Down
13 changes: 7 additions & 6 deletions FS19_AutoDrive/scripts/AutoDriveGraphHandling.lua
Original file line number Diff line number Diff line change
Expand Up @@ -629,14 +629,14 @@ end

function AutoDrive:findClosestWayPoint(veh)
if veh.ad.closest ~= nil then
return veh.ad.closest
return veh.ad.closest, veh.ad.closestDistance;
end

--returns waypoint closest to vehicle position
local x1, y1, z1 = getWorldTranslation(veh.components[1].node)
local closest = -1
local distance = math.huge --AutoDrive:getDistance(AutoDrive.mapWayPoints[1].x,AutoDrive.mapWayPoints[1].z,x1,z1);
if AutoDrive.mapWayPoints[1] ~= nil then
local distance = math.huge --AutoDrive:getDistance(AutoDrive.mapWayPoints[1].x,AutoDrive.mapWayPoints[1].z,x1,z1);
for i in pairs(AutoDrive.mapWayPoints) do
local dis = AutoDrive:getDistance(AutoDrive.mapWayPoints[i].x, AutoDrive.mapWayPoints[i].z, x1, z1)
if dis < distance then
Expand All @@ -647,8 +647,9 @@ function AutoDrive:findClosestWayPoint(veh)
end

veh.ad.closest = closest
veh.ad.closestDistance = distance

return closest
return closest, distance
end

function AutoDrive:findMatchingWayPointForVehicle(veh)
Expand All @@ -658,13 +659,13 @@ function AutoDrive:findMatchingWayPointForVehicle(veh)
local vehicleVector = {x = rx, z = rz}
local point = {x = x1, z = z1}

local bestPoint = AutoDrive:findMatchingWayPoint(point, vehicleVector, 1, 20)
local bestPoint, distance = AutoDrive:findMatchingWayPoint(point, vehicleVector, 1, 20)

if bestPoint == -1 then
return AutoDrive:findClosestWayPoint(veh)
end

return bestPoint
return bestPoint, distance;
end

function AutoDrive:findMatchingWayPoint(point, direction, rangeMin, rangeMax)
Expand Down Expand Up @@ -713,7 +714,7 @@ function AutoDrive:findMatchingWayPoint(point, direction, rangeMin, rangeMax)
end
end

return closest
return closest, distance;
end

function AutoDrive:getWayPointsInRange(point, rangeMin, rangeMax)
Expand Down
2 changes: 1 addition & 1 deletion FS19_AutoDrive/scripts/AutoDriveTrailerUtil.lua
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ function AutoDrive.handleUnloaderSpecificStates(vehicle, trailers, fillLevel, le
vehicle.ad.distanceToCombine = MathUtil.vector2Length(combineWorldX - worldX, combineWorldZ - worldZ)
end

if vehicle.ad.combineState == AutoDrive.DRIVE_TO_COMBINE or vehicle.ad.combineState == AutoDrive.WAIT_TILL_UNLOADED or (vehicle.ad.distanceToCombine < 30) then
if vehicle.ad.combineState == AutoDrive.WAIT_FOR_COMBINE or vehicle.ad.combineState == AutoDrive.DRIVE_TO_COMBINE or vehicle.ad.combineState == AutoDrive.WAIT_TILL_UNLOADED or (vehicle.ad.distanceToCombine < 30) then
AutoDrive.setTrailerCoverOpen(vehicle, trailers, true) --open
AutoDrive.setAugerPipeOpen(trailers, false)
end
Expand Down

0 comments on commit 7b5e6f1

Please sign in to comment.