feat: spuSellBlock slår salgssteder fra/til pr. savegame

This commit is contained in:
2026-09-30 23:35:01 +02:00
parent e229a27624
commit bb287a8154
7 changed files with 169 additions and 4 deletions
+8 -3
View File
@@ -644,7 +644,12 @@ function ADSources.describeAccepted(station)
return table.concat(names, ", ")
end
-- Markører hvis aflæsningsstation er et rigtigt salgssted: { {marker, station} }.
-- Salgssted spilleren har slået fra (spuSellBlock, ADSellBlock).
function ADSources.isSellBlocked(station)
return ADSellBlock ~= nil and ADSellBlock.isBlocked ~= nil and ADSellBlock.isBlocked(station) == true
end
-- Markører hvis aflæsningsstation er et rigtigt salgssted (og ikke slået fra): { {marker, station} }.
function ADSources.getSellMarkers(adEnv, farmId)
return cacheGet("sellMarkers", tostring(farmId), 10000, function() return ADSources.findSellMarkers(adEnv, farmId) end)
end
@@ -653,7 +658,7 @@ function ADSources.findSellMarkers(adEnv, farmId)
local result = {}
for _, marker in pairs(adEnv.ADGraphManager:getMapMarkers()) do
local station = ADSmartPickup.getUnloadStationAtWayPointId(adEnv, marker.id, farmId)
if station ~= nil and ADPrices.isSellingStation(station) then
if station ~= nil and ADPrices.isSellingStation(station) and not ADSources.isSellBlocked(station) then
table.insert(result, {marker = marker, station = station})
end
end
@@ -1002,7 +1007,7 @@ function ADSources.getMarketQuote(fillType)
local storage = g_currentMission ~= nil and g_currentMission.storageSystem or nil
local best = nil
for _, station in pairs(storage ~= nil and storage:getUnloadingStations() or {}) do
if ADPrices.isSellingStation(station) and ADSources.stationAccepts(station, fillType) then
if ADPrices.isSellingStation(station) and not ADSources.isSellBlocked(station) and ADSources.stationAccepts(station, fillType) then
local quote = ADPrices.getQuote(station, fillType)
if quote ~= nil and (best == nil or quote.price > best.price) then
best = {price = quote.price, top = quote.top}