fix(høst): høstere får CP "Stop for unloading" slået til — tømmevognen kørte i ring (v1.62.262)
This commit is contained in:
@@ -244,6 +244,16 @@ local function parkMarkerId(adEnv, vehicle)
|
||||
end
|
||||
ADFieldWork.parkMarkerId = parkMarkerId
|
||||
|
||||
-- Høster på marken skal stoppe ved fuld tank, så CP's tømmevogn kan tømme den (ADCpBridge.ensureStopForUnload).
|
||||
-- Spillerens egne (manuelle) høstere røres ikke. Indstillingen bliver stående (brugerønske 16/10).
|
||||
local function ensureHarvesterStops(assignment)
|
||||
if assignment.role ~= "harvester" or assignment.manual then return end
|
||||
if ADCpBridge.ensureStopForUnload(assignment.vehicle) then
|
||||
log(assignment.fieldId, "'%s': Courseplay \"Stop for unloading\" slået til (ellers kører tømmevognen i ring)",
|
||||
ADRuns.vehicleLabel(assignment.vehicle))
|
||||
end
|
||||
end
|
||||
|
||||
local function restLoad(adEnv, vehicle)
|
||||
local ok, level = pcall(function()
|
||||
return (adEnv.AutoDrive.getAllFillLevels(adEnv.AutoDrive.getAllUnits(vehicle)))
|
||||
@@ -1547,6 +1557,9 @@ local function beginUnloader(adEnv, field, info, assignment)
|
||||
local waitX, waitZ = markerPoint ~= nil and markerPoint.x or point.x, markerPoint ~= nil and markerPoint.z or point.z
|
||||
local wait = ADFieldJobs.waitSpot(info.verts, waitX, waitZ, info.x, info.z, ADFieldWork.UNLOADER_WAIT_INSET_M, ADFieldWork.UNLOADER_WAIT_SIDE_M)
|
||||
if wait ~= nil then waitX, waitZ = wait.x, wait.z end
|
||||
for _, other in pairs(ADFieldJobs.state.assignments) do
|
||||
if other.fieldId == field.id then ensureHarvesterStops(other) end
|
||||
end
|
||||
local handle, err = ADCpBridge.startUnloader(vehicle, point.x, point.z, waitX, waitZ, station, function(ok, reason)
|
||||
if ok then
|
||||
assignment.phase = "working"
|
||||
@@ -1766,6 +1779,7 @@ local function beginWork(adEnv, field, info, assignment)
|
||||
elseif assignment.role == "harvester" then
|
||||
note(field.id, {harvestVehicleId = assignment.vehicleId})
|
||||
rememberCourse(field, "harvester", vehicle)
|
||||
ensureHarvesterStops(assignment)
|
||||
end
|
||||
if assignment.leader and (assignment.groupSize or 1) > 1 then
|
||||
rememberCourse(field, field.stage, vehicle)
|
||||
|
||||
Reference in New Issue
Block a user