fix: salgsmarkør slås også op fra stationen via AD-vej gennem triggeren (v1.62.55)
This commit is contained in:
@@ -681,7 +681,39 @@ function ADSources.findSellMarkers(adEnv, farmId)
|
||||
table.insert(entries, {marker = marker, station = station, through = okThrough and through == true})
|
||||
end
|
||||
end
|
||||
return ADSources.pickStationMarkers(entries)
|
||||
return ADSources.pickStationMarkers(ADSources.addThroughMarkers(adEnv, entries))
|
||||
end
|
||||
|
||||
-- Markør->station giver hver markør kun den nærmeste station. Kører en anden markørs AD-vej gennem stationens
|
||||
-- trigger, kommer den med for stationen (pickStationMarkers dropper så dem der ikke gør). In-game 7/10: "Buy All"
|
||||
-- kører gennem både væske- og bulkmarkedet, men var kun bulkmarkedets -> gyllen skulle sælges ved "Palleskur 2 load".
|
||||
function ADSources.addThroughMarkers(adEnv, entries)
|
||||
if ADFieldWork == nil or ADFieldWork.throughMarkerAt == nil then
|
||||
return entries
|
||||
end
|
||||
local byStation, stations = {}, {}
|
||||
for _, entry in ipairs(entries) do
|
||||
if byStation[entry.station] == nil then
|
||||
byStation[entry.station] = {}
|
||||
table.insert(stations, entry.station)
|
||||
end
|
||||
byStation[entry.station][entry.marker.id] = entry
|
||||
end
|
||||
local result = {}
|
||||
for _, entry in ipairs(entries) do table.insert(result, entry) end
|
||||
for _, station in ipairs(stations) do
|
||||
local ok, id = pcall(ADFieldWork.throughMarkerAt, adEnv, ADSmartPickup.unloadTriggerPoints(station), ADSmartPickup.MAX_MARKER_TO_TRIGGER_DISTANCE or 40)
|
||||
local marker = ok and id ~= nil and adEnv.ADGraphManager:getMapMarkerByWayPointId(id) or nil
|
||||
if marker ~= nil then
|
||||
local existing = byStation[station][id]
|
||||
if existing ~= nil then
|
||||
existing.through = true
|
||||
else
|
||||
table.insert(result, {marker = marker, station = station, through = true})
|
||||
end
|
||||
end
|
||||
end
|
||||
return result
|
||||
end
|
||||
|
||||
-- ---- paller til lager: objektlager (palleskur) som mål ----
|
||||
|
||||
Reference in New Issue
Block a user