Fix - New game load crashes. Add defensive check. (#4216)

Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/4216
Reviewed-by: the-real-herowl <the-real-herowl@noreply.git.minetest.land>
Co-authored-by: ancientmarinerdev <ancientmariner_dev@proton.me>
Co-committed-by: ancientmarinerdev <ancientmariner_dev@proton.me>
This commit is contained in:
ancientmarinerdev 2024-03-27 00:22:22 +00:00 committed by the-real-herowl
parent 8931576c50
commit 0b521ef92b

@ -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