aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--advtrains/trainhud.lua19
1 files changed, 10 insertions, 9 deletions
diff --git a/advtrains/trainhud.lua b/advtrains/trainhud.lua
index 6332c47..0175410 100644
--- a/advtrains/trainhud.lua
+++ b/advtrains/trainhud.lua
@@ -26,7 +26,7 @@ function advtrains.on_control_change(pc, train, flip)
if pc.right then
train.tarvelocity = 8
end
- if pc.jump then
+ --[[if pc.jump then
train.brake = true
--0: released, 1: brake and pressed, 2: released and brake, 3: pressed and brake
if not train.brake_hold_state or train.brake_hold_state==0 then
@@ -39,18 +39,22 @@ function advtrains.on_control_change(pc, train, flip)
elseif train.brake_hold_state==3 then
train.brake = false
train.brake_hold_state = 0
- end
+ end]]
--shift+use:see wagons.lua
else
local act=false
- if pc.up then
- train.ctrl.user=4
- act=true
- end
if pc.jump then
train.ctrl.user = 1
act=true
end
+ -- If atc command set, only "Jump" key can clear command. To prevent accidental control.
+ if train.tarvelocity or train.atc_command then
+ return
+ end
+ if pc.up then
+ train.ctrl.user=4
+ act=true
+ end
if pc.down then
if train.velocity>0 then
if pc.jump then
@@ -81,9 +85,6 @@ function advtrains.on_control_change(pc, train, flip)
if not act then
train.ctrl.user = nil
end
- if pc.aux1 then
- --horn
- end
end
end
function advtrains.update_driver_hud(pname, train, flip)