fix(markarbejde): påfyldning også ved købestationer (buyingStation, ingen lagerbeholdning) — 'Liquid Buy Station' blev aldrig fundet; markør inden for 30 m af trigger eller 40 m af bygningen (v1.29.3.0)

This commit is contained in:
2026-09-26 15:45:05 +02:00
parent 455c9c7598
commit 813ee6d0b9
3 changed files with 86 additions and 11 deletions
+22
View File
@@ -0,0 +1,22 @@
-- Kør: luajit tests/test_adFieldWorkBuying.lua (fra repo-roden)
-- Påfyldning ved købestation (in-game 26/9: "Liquid Buy Station", FarmFillStations buyingStationConfigurable):
-- ingen lagerbeholdning, så varen læses fra udbud/triggere/AI-varer.
local failures = 0
local function check(name, actual, expected)
if actual == expected then print("OK " .. name) else
failures = failures + 1
print(string.format("FAIL %s: forventede %s, fik %s", name, tostring(expected), tostring(actual)))
end
end
Logging = {info = function() end, warning = function() end}
dofile("FS25_ADSmartPickup/adFieldWork.lua")
local HERBICIDE, LIME, SEEDS = 20, 21, 22
local W = ADFieldWork
check("BS1 udbudte varer", W.buyingSupports({providedFillTypes = {[HERBICIDE] = true}}, HERBICIDE), true)
check("BS2 triggerens varer", W.buyingSupports({loadTriggers = {{fillTypes = {[HERBICIDE] = true}}}}, HERBICIDE), true)
check("BS3 AI-varer", W.buyingSupports({getAISupportedFillTypes = function() return {[SEEDS] = true} end}, SEEDS), true)
check("BS4 sælger ikke kalk", W.buyingSupports({providedFillTypes = {[HERBICIDE] = true}}, LIME), false)
check("BS5 fejl i opslag = nej", W.buyingSupports({getAISupportedFillTypes = function() error("x") end}, LIME), false)
check("BS6 ingen station", W.buyingSupports(nil, LIME), false)
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
os.exit(failures == 0 and 0 or 1)