From 0698673c28f3130ca8d7c542c9cb28a65e865daa Mon Sep 17 00:00:00 2001 From: Elias Fleckenstein <54945686+EliasFleckenstein03@users.noreply.github.com> Date: Mon, 4 Oct 2021 19:08:30 +0200 Subject: [PATCH] Fix crashing on HUD removal --- functions.lua | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/functions.lua b/functions.lua index 8d24d5d..404fb1f 100644 --- a/functions.lua +++ b/functions.lua @@ -138,9 +138,15 @@ minetest.register_globalstep (function(dtime) player:set_physics_override({ speed = 1, }) - player:hud_remove(p.hud.ui) - player:hud_remove(p.hud.icon) - player:hud_remove(p.hud.time) + if p.hud.ui then + player:hud_remove(p.hud.ui) + 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)