aboutsummaryrefslogtreecommitdiff
path: root/trainhud.lua
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2016-06-09 17:35:06 +0200
committerorwell96 <mono96.mml@gmail.com>2016-06-09 17:35:06 +0200
commita879ce8d3c179b5c6b88c9db610d560228d1e5b4 (patch)
tree477a062c99baca9673b4127e89f49dab3e1d148c /trainhud.lua
parente449704a92c8c1931fb687e58f095bea27db3ddc (diff)
downloadadvtrains-a879ce8d3c179b5c6b88c9db610d560228d1e5b4.tar.gz
advtrains-a879ce8d3c179b5c6b88c9db610d560228d1e5b4.tar.bz2
advtrains-a879ce8d3c179b5c6b88c9db610d560228d1e5b4.zip
Fix train collision and coupling on opposing trains, and try to implement animation (currently does not work)
Diffstat (limited to 'trainhud.lua')
-rw-r--r--trainhud.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/trainhud.lua b/trainhud.lua
index b64c81c..601b28f 100644
--- a/trainhud.lua
+++ b/trainhud.lua
@@ -33,8 +33,8 @@ function advtrains.hud_train_format(train, flip)
if flip then fct=-1 end
if not train then return "" end
local max=advtrains.all_traintypes[train.traintype].max_speed or 10
- local vel=math.ceil(train.velocity)*fct
- local tvel=math.ceil(train.tarvelocity)*fct
+ local vel=advtrains.abs_ceil(train.velocity)*fct
+ local tvel=advtrains.abs_ceil(train.tarvelocity)*fct
local firstLine, secondLine
if vel<0 then
firstLine="Speed: <"..string.rep("_", vel+max)..string.rep("+", -vel).."|"..string.rep("_", max)..">"