From 171344f81838e5e4393bcbf52e807de6c6fb9617 Mon Sep 17 00:00:00 2001 From: rubin Date: Sat, 14 Jan 2023 14:49:49 +0300 Subject: [PATCH] pair_timestamp fix & add url print --- TruckHUD.lua | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/TruckHUD.lua b/TruckHUD.lua index a4abf7d..21dcb64 100644 --- a/TruckHUD.lua +++ b/TruckHUD.lua @@ -102,7 +102,7 @@ local pickupLoad = { } local newMarkers = {} local pair_table = {} -local pair_timestamp = {} +local pair_timestamp = 0 local pair_status = 0 local response_timestamp = 0 local transponder_delay = 500 @@ -1114,13 +1114,15 @@ function doRenderStats() end end - local afk_wait = (live-pair_afk_stop.player_live > 3 and live-pair_afk_stop.player_live or - (pair_timestamp-pair_afk_stop.pair_live > 3 and pair_timestamp-pair_afk_stop.pair_live or 0)) - if afk_wait > 0 then - pair_afk_stop.auto_stop = os.time() + if pair_timestamp ~= nil then + local afk_wait = (live-pair_afk_stop.player_live > 3 and live-pair_afk_stop.player_live or + (pair_timestamp-pair_afk_stop.pair_live > 3 and pair_timestamp-pair_afk_stop.pair_live or 0)) + if afk_wait > 0 then + pair_afk_stop.auto_stop = os.time() + end + pair_afk_stop.player_live = live + pair_afk_stop.pair_live = pair_timestamp end - pair_afk_stop.player_live = live - pair_afk_stop.pair_live = pair_timestamp local X, Y, c1, c2 = inifiles.Settings.X1, inifiles.Settings.Y1, inifiles.Render.Color1, inifiles.Render.Color2 local down = (renderGetFontDrawHeight(font) / 6)