diff options
author | orwell96 <mono96.mml@gmail.com> | 2016-12-22 18:55:10 +0100 |
---|---|---|
committer | orwell96 <mono96.mml@gmail.com> | 2016-12-22 18:55:10 +0100 |
commit | d08e202346192c50072450a3eaa3b28cad852b84 (patch) | |
tree | fcb449a63df2c21178fba742d2121cb98c0ff6ab /advtrains/trainhud.lua | |
parent | f806ed9eee8c13eb0b4868641311d25257c63f46 (diff) | |
download | advtrains-d08e202346192c50072450a3eaa3b28cad852b84.tar.gz advtrains-d08e202346192c50072450a3eaa3b28cad852b84.tar.bz2 advtrains-d08e202346192c50072450a3eaa3b28cad852b84.zip |
remove train type concept and calculate train's capabilities based on used wagons
Diffstat (limited to 'advtrains/trainhud.lua')
-rw-r--r-- | advtrains/trainhud.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/advtrains/trainhud.lua b/advtrains/trainhud.lua index aead246..19e4f6f 100644 --- a/advtrains/trainhud.lua +++ b/advtrains/trainhud.lua @@ -94,14 +94,14 @@ function advtrains.set_trainhud(name, text) end function advtrains.hud_train_format(train, flip) local fct=flip and -1 or 1 - if not train or not train.traintype then return "" end + if not train then return "" end - local max=advtrains.all_traintypes[train.traintype].max_speed or 10 + local max=train.max_speed or 10 local vel=advtrains.abs_ceil(train.velocity) local tvel=advtrains.abs_ceil(train.tarvelocity) local topLine, firstLine, secondLine - topLine=train.traintype.." ["..mletter[fct*train.movedir].."] "..(train.brake and "="..( train.brake_hold_state==2 and "^" or "" ).."B=" or "") + topLine="Train".." ["..mletter[fct*train.movedir].."] "..(train.brake and "="..( train.brake_hold_state==2 and "^" or "" ).."B=" or "") firstLine="Speed: |"..string.rep("+", vel)..string.rep("_", max-vel)..">" secondLine="Target: |"..string.rep("+", tvel)..string.rep("_", max-tvel)..">" |