Set Zs3v only if upcoming speed limit is stricter
This commit is contained in:
parent
5695a3e9ee
commit
e47fe6f8cf
|
@ -60,14 +60,16 @@ local setaspectf = function(rot)
|
|||
end
|
||||
setzs3v(pos, nil, rot)
|
||||
else
|
||||
if not asp.dst or asp.dst == -1 then
|
||||
local dst = asp.dst
|
||||
if not dst or dst == -1 or advtrains.speed.not_lessp(dst, asp.main) then
|
||||
advtrains.ndb.swap_node(pos, {name="advtrains_signals_ks:hs_free_"..rot, param2 = node.param2})
|
||||
elseif asp.dst == 0 then
|
||||
dst = -1
|
||||
elseif dst == 0 then
|
||||
advtrains.ndb.swap_node(pos, {name="advtrains_signals_ks:hs_slow_"..rot, param2 = node.param2})
|
||||
else
|
||||
advtrains.ndb.swap_node(pos, {name="advtrains_signals_ks:hs_nextslow_"..rot, param2 = node.param2})
|
||||
end
|
||||
setzs3v(pos, asp.dst, rot)
|
||||
setzs3v(pos, dst, rot)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue