aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authororwell96 <orwell@bleipb.de>2021-02-10 17:07:38 +0100
committerorwell96 <orwell@bleipb.de>2021-02-10 17:07:38 +0100
commit17e29a251102271d1a5b045dde45cd68c0e728c3 (patch)
treecbfba21209c3998f0ec9be61b85d97e617d9cb5b
parentfad6f88bab0dc0d3999f2845d1144b7936c1a370 (diff)
downloadadvtrains-17e29a251102271d1a5b045dde45cd68c0e728c3.tar.gz
advtrains-17e29a251102271d1a5b045dde45cd68c0e728c3.tar.bz2
advtrains-17e29a251102271d1a5b045dde45cd68c0e728c3.zip
Make anti-LZB-flicker system work after rebase onto hud redesign
-rw-r--r--advtrains/trainhud.lua5
1 files changed, 4 insertions, 1 deletions
diff --git a/advtrains/trainhud.lua b/advtrains/trainhud.lua
index 429c164..1538774 100644
--- a/advtrains/trainhud.lua
+++ b/advtrains/trainhud.lua
@@ -186,6 +186,9 @@ function advtrains.hud_train_format(train, flip)
local tlev=train.lever or 1
if train.velocity==0 and not train.active_control then tlev=1 end
+ if train.hud_lzb_effect_tmr then
+ tlev=1
+ end
local ht = {"[combine:440x110:0,0=(advtrains_hud_bg.png^[resize\\:440x110)"}
local st = {}
@@ -286,7 +289,7 @@ function advtrains.hud_train_format(train, flip)
ht[#ht+1] = sformat("%d,50=(advtrains_hud_arrow.png^[multiply\\:red^[makealpha\\:#000000)", 1+spd*11)
end
local floor = math.floor
- local dist = floor(((oc[i].idx or train.index)-train.index))
+ local dist = floor(((oc[i].index or train.index)-train.index))
dist = math.max(0, math.min(999, dist))
for j = 1, 3, 1 do
sevenseg(floor((dist/10^(3-j))%10), 119+j*11, 18, 4, 2, "[colorize\\:"..c)