Fix crashing on HUD removal

This commit is contained in:
Extex101 2021-10-06 10:44:51 -07:00 committed by GitHub
commit 946d79eac6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -138,9 +138,15 @@ minetest.register_globalstep (function(dtime)
player:set_physics_override({ player:set_physics_override({
speed = 1, speed = 1,
}) })
player:hud_remove(p.hud.ui) if p.hud.ui then
player:hud_remove(p.hud.icon) player:hud_remove(p.hud.ui)
player:hud_remove(p.hud.time) end
if p.hud.icon then
player:hud_remove(p.hud.icon)
end
if p.hud.time then
player:hud_remove(p.hud.time)
end
end end
end end
end) end)