From 5fe4ded673a2bc38f5019ce2a647863353355282 Mon Sep 17 00:00:00 2001 From: Wouters Dorian Date: Thu, 13 Aug 2015 16:39:26 +0200 Subject: [PATCH] Fix [food] crashing when damage is disabled (hbhunger not loading) --- mods/food/food/init.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mods/food/food/init.lua b/mods/food/food/init.lua index ca814d00..0106f3d9 100755 --- a/mods/food/food/init.lua +++ b/mods/food/food/init.lua @@ -107,11 +107,12 @@ function food.item_eat(amt) elseif minetest.get_modpath("hud") and hud and hud.item_eat then return hud.item_eat(amt) elseif minetest.get_modpath("hbhunger") then - if hbhunger then - return hbhunger.item_eat(amt) - else + if hbhunger and hbhunger.item_eat then -- hbhunger is nil when world is loaded with damage disabled return hbhunger.item_eat(amt) end + return function(...) end + elseif minetest.get_modpath("hunger") and hunger and hunger.item_eat then + return hunger.item_eat(amt) else return minetest.item_eat(amt) end