aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/init.lua2
-rw-r--r--advtrains/signals.lua1
-rw-r--r--advtrains/trainhud.lua9
-rw-r--r--advtrains/trainlogic.lua10
4 files changed, 15 insertions, 7 deletions
diff --git a/advtrains/init.lua b/advtrains/init.lua
index 5d1af41..218c180 100644
--- a/advtrains/init.lua
+++ b/advtrains/init.lua
@@ -293,7 +293,7 @@ advtrains.avt_save = function(remove_players_from_wagons)
"trainparts", "recently_collided_with_env",
"atc_brake_target", "atc_wait_finish", "atc_command", "atc_delay", "door_open",
"text_outside", "text_inside", "line",
- "il_sections", "speed_restriction",
+ "il_sections", "speed_restriction", "is_shunt",
})
--then save it
tmp_trains[id]=v
diff --git a/advtrains/signals.lua b/advtrains/signals.lua
index 135fae9..b3dceca 100644
--- a/advtrains/signals.lua
+++ b/advtrains/signals.lua
@@ -18,6 +18,7 @@ return {
},
shunt = {
free = false,
+ proceed_as_main = true
},
dst = {
free = true,
diff --git a/advtrains/trainhud.lua b/advtrains/trainhud.lua
index 407518f..8630d62 100644
--- a/advtrains/trainhud.lua
+++ b/advtrains/trainhud.lua
@@ -197,13 +197,14 @@ function advtrains.hud_train_format(train, flip)
secondLine="ATC"..b..": "..tvels..ad..(train.atc_command or "")
else
secondLine = "Manual operation"
+ if train.ctrl.lzb then
+ secondLine = "-!- Safety override -!-"
+ end
end
- if train.ctrl.lzb then
- secondLine = "-!- Safety override -!-"
- end
+ local shtind = train.is_shunt and "S" or ">"
topLine=" ["..mletter[fct].."] {"..levers.."} "..doorstr[(train.door_open or 0) * fct].." "..(train.line and "L: "..train.line or "")
- firstLine=attrans("Speed:").." |"..string.rep("+", vel)..string.rep("_", res-vel).."|"..string.rep("_", max-res).."> "..vel_kmh.." km/h"
+ firstLine=attrans("Speed:").." |"..string.rep("+", vel)..string.rep("_", res-vel).."|"..string.rep("_", max-res)..shtind.." "..vel_kmh.." km/h"
if train.speed_restriction == 0 then
firstLine = "OVERRUN RED SIGNAL! Examine situation and reverse train to move again."
end
diff --git a/advtrains/trainlogic.lua b/advtrains/trainlogic.lua
index a55c5dc..965fcbd 100644
--- a/advtrains/trainlogic.lua
+++ b/advtrains/trainlogic.lua
@@ -1036,8 +1036,14 @@ function advtrains.invert_train(train_id)
end
advtrains.update_trainpart_properties(train_id, true)
- -- TODO: this should actually be SHUNT_MAX_SPEED, but signals and lzb is not present everywhere
- train.speed_restriction = nil
+ -- If interlocking present, check whether this train is in a section and then set as shunt move after reversion
+ if advtrains.interlocking and train.il_sections and #train.il_sections > 0 then
+ train.is_shunt = true
+ train.speed_restriction = advtrains.SHUNT_SPEED_MAX
+ else
+ train.is_shunt = false
+ train.speed_restriction = nil
+ end
end
-- returns: train id, index of one of the trains that stand at this position.