mirror of
https://github.com/kestral246/hud_compass.git
synced 2024-11-27 09:33:44 +01:00
Check hud_change return code.
This commit is contained in:
parent
50f0936f3f
commit
a25d30eca0
7
init.lua
7
init.lua
@ -61,8 +61,11 @@ minetest.register_globalstep(function(dtime)
|
||||
local image = math.floor((angle_relative/22.5) + 0.5)%16
|
||||
|
||||
if hud_compass[pname].enabled and image ~= hud_compass[pname].last_image then
|
||||
player:hud_change(hud_compass[pname].id, "text", "realcompass_"..image..".png")
|
||||
hud_compass[pname].last_image = image
|
||||
local rc = player:hud_change(hud_compass[pname].id, "text", "realcompass_"..image..".png")
|
||||
-- Check return code, seems to fix occasional startup glitch.
|
||||
if rc == 1 then
|
||||
hud_compass[pname].last_image = image
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
Loading…
Reference in New Issue
Block a user