diff options
author | Y. Wang <yw05@forksworld.de> | 2023-06-02 15:17:14 +0200 |
---|---|---|
committer | gpcf <gpcf@gpcf.eu> | 2024-08-08 22:48:23 +0200 |
commit | e9aad541ccab298b3d9604441bccc05d775bce3a (patch) | |
tree | 37f68f0449aa245639b9f8e4e13b480fec887c1e /advtrains/texture.lua | |
parent | 0bfc7bbe099c7bba20cf1194b3ffad9471d0c7a4 (diff) | |
download | advtrains-e9aad541ccab298b3d9604441bccc05d775bce3a.tar.gz advtrains-e9aad541ccab298b3d9604441bccc05d775bce3a.tar.bz2 advtrains-e9aad541ccab298b3d9604441bccc05d775bce3a.zip |
Fix incorrect speed indicator; include routing info in text HUD
Diffstat (limited to 'advtrains/texture.lua')
-rw-r--r-- | advtrains/texture.lua | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/advtrains/texture.lua b/advtrains/texture.lua index 1ecc91b..e6d83b0 100644 --- a/advtrains/texture.lua +++ b/advtrains/texture.lua @@ -125,12 +125,12 @@ local function add_segmentbar(n, self, x, y, w, h, m, c, ...) local bs = ss - m for k = 1, argc, 3 do local lower, upper, fill = argv[k], argv[k+1], argv[k+2] - lower = math.max(0, math.floor(lower)+1) + lower = math.max(0, math.floor(lower))+1 upper = math.min(c, math.floor(upper)) - if lower < upper then + if lower <= upper then local args = {x, y, w, h, fill} args[n+2] = bs - args[n] = args[n] + ss*lower + args[n] = args[n] + ss*(lower-1) for i = lower, upper do self:add_fill(unpack(args)) args[n] = args[n] + ss |