From b8161eb2496f23dff597db76ace45412513ef5dc Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 24 Oct 2016 17:50:07 +0200 Subject: [PATCH] Bugfix: Incorrect speed when being attached --- init.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/init.lua b/init.lua index 3abd154..51d484c 100644 --- a/init.lua +++ b/init.lua @@ -278,7 +278,13 @@ function update_hud_displays(player) str_time = "" end - local speed = vector.length(player:get_player_velocity()) + local speed + local attach = player:get_attach() + if attach == nil then + speed = vector.length(player:get_player_velocity()) + else + speed = vector.length(attach:getvelocity()) + end if speedometer or quadcorder then str_speed = string.format(S("Speed: %.1f %s"), speed, orienteering.settings.speed_unit) else