mirror of
https://repo.or.cz/minetest_orienteering.git
synced 2025-01-09 22:27:30 +01:00
Bugfix: Incorrect speed when being attached
This commit is contained in:
parent
47bfbb75fd
commit
b8161eb249
8
init.lua
8
init.lua
@ -278,7 +278,13 @@ function update_hud_displays(player)
|
|||||||
str_time = ""
|
str_time = ""
|
||||||
end
|
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
|
if speedometer or quadcorder then
|
||||||
str_speed = string.format(S("Speed: %.1f %s"), speed, orienteering.settings.speed_unit)
|
str_speed = string.format(S("Speed: %.1f %s"), speed, orienteering.settings.speed_unit)
|
||||||
else
|
else
|
||||||
|
Loading…
Reference in New Issue
Block a user