fix: løst stationsopslag (40 m, uanset retning) for stalde og fabrikker — mælketank ved siden af markøren genkendes (v1.12.21.0)

This commit is contained in:
2026-09-23 18:06:04 +02:00
parent 034286f69e
commit 4a283b086f
5 changed files with 59 additions and 1 deletions
+17
View File
@@ -141,6 +141,19 @@ function ADSources.identify(adEnv, wayPointId, farmId)
if placeable ~= nil and placeable.getHusbandryFillLevel ~= nil then
return {kind = "husbandry", placeable = placeable, station = station, wayPointId = wayPointId, name = getPlaceableName(placeable, markerName)}
end
-- Det strenge opslag (trigger bag næsen) passer til silorækker; en mælketank eller fabrik ligger
-- ofte ved siden af markøren. Løst opslag inden for 40 m — men aldrig for siloer.
if placeable == nil and ADSmartPickup.getLoadStationNearWayPointId ~= nil then
local loose = ADSmartPickup.getLoadStationNearWayPointId(adEnv, wayPointId, farmId, ADSources.MAX_DISTANCE)
local loosePlaceable = loose ~= nil and loose.owningPlaceable or nil
if loosePlaceable ~= nil and loosePlaceable.spec_silo == nil then
if getProductionPoint(loosePlaceable) ~= nil then
return {kind = "factory", placeable = loosePlaceable, station = loose, wayPointId = wayPointId, name = getPlaceableName(loosePlaceable, markerName)}
elseif loosePlaceable.getHusbandryFillLevel ~= nil then
return {kind = "husbandry", placeable = loosePlaceable, station = loose, wayPointId = wayPointId, name = getPlaceableName(loosePlaceable, markerName)}
end
end
end
-- Rene pallefabrikker (halmvarer, bageri ...) har ingen læssestation: find dem på afstand
-- til pallespawneren; dernæst objektlagre.
local factory = findPlaceableNear(wayPoint, farmId, isProductionPoint)
@@ -164,6 +177,10 @@ function ADSources.explainMarker(adEnv, wayPointId, farmId)
end
local station = ADSmartPickup.getLoadStationAtWayPointId(adEnv, wayPointId, farmId)
if station == nil then
local loose = ADSmartPickup.getLoadStationNearWayPointId ~= nil and ADSmartPickup.getLoadStationNearWayPointId(adEnv, wayPointId, farmId, ADSources.MAX_DISTANCE) or nil
if loose ~= nil and loose.owningPlaceable ~= nil and loose.owningPlaceable.spec_silo ~= nil then
return string.format("nærmeste læssestation inden for 40 m er en silo ('%s'), som kræver at markøren står i køresporet med triggeren bag næsen", getPlaceableName(loose.owningPlaceable, "?"))
end
local factory = findPlaceableNear(wayPoint, farmId, isProductionPoint)
local storage = findPlaceableNear(wayPoint, farmId, isObjectStorage)
if factory == nil and storage == nil then