fix(parkering): parkeringspunkt findes også på vognen/redskabet (advd.parkDestination) — AD kopierer det først til traktoren ved tilkobling; efter indlæsning manglede 4 af 9 (v1.42.1.0)
This commit is contained in:
@@ -96,6 +96,15 @@ ADFieldWork.enableParkAtJobFinished = enableParkAtJobFinished
|
|||||||
local function parkMarkerId(adEnv, vehicle)
|
local function parkMarkerId(adEnv, vehicle)
|
||||||
local module = stateModule(vehicle)
|
local module = stateModule(vehicle)
|
||||||
local index = module ~= nil and module.getParkDestinationAtJobFinished ~= nil and module:getParkDestinationAtJobFinished() or nil
|
local index = module ~= nil and module.getParkDestinationAtJobFinished ~= nil and module:getParkDestinationAtJobFinished() or nil
|
||||||
|
-- parkeringen kan ligge på vognen/redskabet (advd.parkDestination); AD kopierer den først til traktoren når
|
||||||
|
-- redskabet kobles på/vælges — efter indlæsning er kopien ofte tom (in-game 27/9: 20 af 25 "uden parkering")
|
||||||
|
if index == nil or index < 1 then
|
||||||
|
local ok, units = pcall(adEnv.AutoDrive.getAllUnits, vehicle)
|
||||||
|
for _, unit in ipairs(ok and units or {}) do
|
||||||
|
local own = unit.advd ~= nil and unit.advd.parkDestination or nil
|
||||||
|
if type(own) == "number" and own >= 1 then index = own break end
|
||||||
|
end
|
||||||
|
end
|
||||||
if index == nil or index < 1 then return nil end
|
if index == nil or index < 1 then return nil end
|
||||||
local marker = adEnv.ADGraphManager:getMapMarkerById(index)
|
local marker = adEnv.ADGraphManager:getMapMarkerById(index)
|
||||||
return marker ~= nil and marker.id or nil
|
return marker ~= nil and marker.id or nil
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||||
<modDesc descVersion="107">
|
<modDesc descVersion="107">
|
||||||
<author>masterdraco</author>
|
<author>masterdraco</author>
|
||||||
<version>1.42.0.0</version>
|
<version>1.42.1.0</version>
|
||||||
<title>
|
<title>
|
||||||
<en>AD Smart Pickup</en>
|
<en>AD Smart Pickup</en>
|
||||||
</title>
|
</title>
|
||||||
|
|||||||
Reference in New Issue
Block a user