Fix crashing on HUD removal

This commit is contained in:
Elias Fleckenstein 2021-10-04 19:08:30 +02:00 committed by GitHub
parent 1424222a69
commit 0698673c28
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)