aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xadvtrains_signals_ks/init.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/advtrains_signals_ks/init.lua b/advtrains_signals_ks/init.lua
index 7e285ae..ff65697 100755
--- a/advtrains_signals_ks/init.lua
+++ b/advtrains_signals_ks/init.lua
@@ -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