summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubenwardy <rubenwardy@gmail.com>2015-10-27 13:47:31 +0000
committerrubenwardy <rubenwardy@gmail.com>2015-10-27 13:47:31 +0000
commit1724db4fba5e9cd87a0d1580c6e2d9869b32ec40 (patch)
tree27c94146928e2b232acd8b66a8bb59fe8e56346b
parent9913055d6a9cdb6a1b56f65e725dc8af96d66afc (diff)
Stop crash on damage disabled.
-rw-r--r--food/init.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/food/init.lua b/food/init.lua
index 9d37f11..4afa950 100644
--- a/food/init.lua
+++ b/food/init.lua
@@ -174,9 +174,9 @@ function food.item_eat(amt)
elseif minetest.get_modpath("hud") and global_exists("hud") and hud.item_eat then
return hud.item_eat(amt)
elseif minetest.get_modpath("hbhunger") then
- if global_exists("hbhunger") then
+ if global_exists("hbhunger") and hbhunger.item_eat then
return hbhunger.item_eat(amt)
- elseif global_exists("hunger") then
+ elseif global_exists("hunger") and hunger.item_eat then
-- For backwards compatibility
-- It used to be called `hunger` rather than `hbhunger`
return hunger.item_eat(amt)