fix(rute): reserve-søgning gennem vejnettet fra traktorens nærmeste waypoint når AD's getPathTo siger nej trods vej (Æg storage -> Chicken Storage Unload) (v1.19.9.0)

This commit is contained in:
2026-09-24 23:42:33 +02:00
parent 5c7f7ba072
commit 3111033805
5 changed files with 61 additions and 4 deletions
+15
View File
@@ -92,5 +92,20 @@ check("W6 state driving", task.state, 2)
check("W6 setPathTo", stopped.pathTo, 10)
check("W6 stopUnloading", stopped.unload, true)
-- WR: AD's rutesøgning siger nej, men vejnettet har en vej fra traktorens nærmeste waypoint -> godtages
-- (in-game 24/9: 'Æg storage' ved Chicken Wait 1, "ingen vej til 'Chicken Storage Unload'" trods vej)
do
wayPoints[901] = {id = 901, x = 0, z = 0, out = {902}}
wayPoints[902] = {id = 902, x = 5, z = 0, out = {903}}
wayPoints[903] = {id = 903, x = 10, z = 0, out = {}}
wayPoints[904] = {id = 904, x = 20, z = 0, out = {}} -- ingen indgang
unreachable[903], unreachable[904] = true, true
local vehicle = {getClosestWayPoint = function() return 901, 1 end}
check("WR AD nej, vejnettet ja -> nåelig", ADWaitPool.hasRouteTo(adEnv, vehicle, 903), true)
check("WR hverken AD eller vejnet -> ikke nåelig", ADWaitPool.hasRouteTo(adEnv, vehicle, 904), false)
check("WR uden nærmeste waypoint -> AD's svar", ADWaitPool.hasRouteTo(adEnv, {}, 903), false)
unreachable[903], unreachable[904] = nil, nil
end
print(failures == 0 and "\nALLE TESTS OK" or ("\n" .. failures .. " FEJL"))
os.exit(failures == 0 and 0 or 1)