From a879ce8d3c179b5c6b88c9db610d560228d1e5b4 Mon Sep 17 00:00:00 2001 From: orwell96 Date: Thu, 9 Jun 2016 17:35:06 +0200 Subject: Fix train collision and coupling on opposing trains, and try to implement animation (currently does not work) --- trainhud.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'trainhud.lua') 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)..">" -- cgit v1.2.3