From 0b521ef92b020eadf312820efdba72c650eebc99 Mon Sep 17 00:00:00 2001 From: ancientmarinerdev Date: Wed, 27 Mar 2024 00:22:22 +0000 Subject: [PATCH] Fix - New game load crashes. Add defensive check. (#4216) Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/4216 Reviewed-by: the-real-herowl Co-authored-by: ancientmarinerdev Co-committed-by: ancientmarinerdev --- mods/PLAYER/mcl_hunger/init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mods/PLAYER/mcl_hunger/init.lua b/mods/PLAYER/mcl_hunger/init.lua index 61b6b72f2..1ad619541 100644 --- a/mods/PLAYER/mcl_hunger/init.lua +++ b/mods/PLAYER/mcl_hunger/init.lua @@ -266,7 +266,7 @@ minetest.register_globalstep(function(dtime) food_tick_timers[player] = food_tick_timer -- update food_tick_timer table -- Eating delay code - if mcl_hunger.eat_internal[player_name].is_eating or mcl_hunger.eat_internal[player_name]._custom_do_delayed then + if mcl_hunger.eat_internal[player_name] and mcl_hunger.eat_internal[player_name].is_eating or mcl_hunger.eat_internal[player_name]._custom_do_delayed then mcl_hunger.eat_internal[player_name].is_eating = true mcl_hunger.eat_internal[player_name].is_eating_no_padding = true