fix(markarbejde): påfyldning fra gårdens eget lager før købestation (gylle blev købt trods 7 mio. l ved BGA) (v1.29.6.0)
This commit is contained in:
@@ -441,15 +441,19 @@ function ADFieldWork.findRefillMarker(adEnv, vehicle, fillType, x, z)
|
|||||||
best, bestDistance = wayPointId, distance
|
best, bestDistance = wayPointId, distance
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
-- gårdens egne lagre først (stalde/tanke med gylle, lager med gødning): købes kun når intet eget findes
|
||||||
|
-- (in-game 26/9: 7 mio. l gylle ved BGA'en, men påfyldningen ville købe ved købestationen)
|
||||||
pcall(function()
|
pcall(function()
|
||||||
for _, station in pairs(g_currentMission.storageSystem:getLoadingStations()) do
|
for _, station in pairs(g_currentMission.storageSystem:getLoadingStations()) do
|
||||||
local supported = station.getAISupportedFillTypes ~= nil and station:getAISupportedFillTypes() or {}
|
local supported = station.getAISupportedFillTypes ~= nil and station:getAISupportedFillTypes() or {}
|
||||||
if g_currentMission.accessHandler:canFarmAccess(farmId, station) and supported[fillType]
|
local isShop = station.owningPlaceable ~= nil and station.owningPlaceable.spec_buyingStation ~= nil
|
||||||
|
if not isShop and g_currentMission.accessHandler:canFarmAccess(farmId, station) and supported[fillType]
|
||||||
and (station:getFillLevel(fillType, farmId) or 0) > 0 then
|
and (station:getFillLevel(fillType, farmId) or 0) > 0 then
|
||||||
consider(markerAtStation(adEnv, vehicle, station, station.owningPlaceable))
|
consider(markerAtStation(adEnv, vehicle, station, station.owningPlaceable))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
if best ~= nil then return best end
|
||||||
pcall(function()
|
pcall(function()
|
||||||
for _, placeable in pairs(g_currentMission.placeableSystem.placeables) do
|
for _, placeable in pairs(g_currentMission.placeableSystem.placeables) do
|
||||||
local spec = placeable.spec_buyingStation
|
local spec = placeable.spec_buyingStation
|
||||||
|
|||||||
@@ -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.29.5.0</version>
|
<version>1.29.6.0</version>
|
||||||
<title>
|
<title>
|
||||||
<en>AD Smart Pickup</en>
|
<en>AD Smart Pickup</en>
|
||||||
</title>
|
</title>
|
||||||
|
|||||||
Reference in New Issue
Block a user