fix(marker): væk sovende køretøjer ved AD-start og under opfølgning (v1.21.6.0)

In-game 25/9: Fastrac'en stod stille ved AutoDrive-start til spilleren satte sig ind (parkerede
køretøjer kalder ikke onUpdate). Samme greb som flows' applyAndStart + raiseActive fra AI-Bonden.
This commit is contained in:
2026-09-25 23:22:04 +02:00
parent 52250dc35e
commit 048f5e6547
4 changed files with 16 additions and 3 deletions
+13
View File
@@ -122,6 +122,16 @@ local function stopAd(vehicle)
if isAdActive(vehicle) then vehicle:stopAutoDrive() end
end
-- Parkerede køretøjer SOVER i FS25 (motoren kalder ikke onUpdate), så AutoDrives køreopgave står stille,
-- til nogen vækker dem (in-game 25/9: Fastrac'en kørte først, da spilleren satte sig ind). Samme greb
-- som flows (applyAndStart) + raiseActive, bevist i AI-Bonden.
local function wake(vehicle, kick)
if vehicle.raiseActive ~= nil then vehicle:raiseActive() end
if kick and vehicle.isServer and SpecializationUtil ~= nil and SpecializationUtil.raiseEvent ~= nil then
SpecializationUtil.raiseEvent(vehicle, "onUpdate", 16, false, false, false)
end
end
local function startAd(adEnv, vehicle, mode, firstId, secondId, withCp)
local module = stateModule(vehicle)
stopAd(vehicle)
@@ -145,6 +155,7 @@ local function startAd(adEnv, vehicle, mode, firstId, secondId, withCp)
else
vehicle:startAutoDrive()
end
wake(vehicle, true)
end
local function parkMarkerId(adEnv, vehicle)
@@ -310,6 +321,8 @@ local function follow(adEnv, assignment)
end
local field = ADFieldJobs.getField(assignment.fieldId)
local info = ADFields.getInfo(assignment.fieldId)
-- hold sættet vågent mens vi har det (AutoDrive-kørsel, CP-start, arbejde, AD-aflæsning)
wake(vehicle)
if assignment.phase == "driving" then
if not isAdActive(vehicle) and ADFieldJobs.now - assignment.since > 2000 then
local x, z = vehiclePosition(vehicle)
+1 -1
View File
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<modDesc descVersion="107">
<author>masterdraco</author>
<version>1.21.5.0</version>
<version>1.21.6.0</version>
<title>
<en>AD Smart Pickup</en>
</title>