mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-12-25 18:20:36 +01:00
Fix [food] crashing when damage is disabled (hbhunger not loading)
This commit is contained in:
parent
a4c02fd0cf
commit
5fe4ded673
@ -107,11 +107,12 @@ function food.item_eat(amt)
|
|||||||
elseif minetest.get_modpath("hud") and hud and hud.item_eat then
|
elseif minetest.get_modpath("hud") and hud and hud.item_eat then
|
||||||
return hud.item_eat(amt)
|
return hud.item_eat(amt)
|
||||||
elseif minetest.get_modpath("hbhunger") then
|
elseif minetest.get_modpath("hbhunger") then
|
||||||
if hbhunger then
|
if hbhunger and hbhunger.item_eat then -- hbhunger is nil when world is loaded with damage disabled
|
||||||
return hbhunger.item_eat(amt)
|
|
||||||
else
|
|
||||||
return hbhunger.item_eat(amt)
|
return hbhunger.item_eat(amt)
|
||||||
end
|
end
|
||||||
|
return function(...) end
|
||||||
|
elseif minetest.get_modpath("hunger") and hunger and hunger.item_eat then
|
||||||
|
return hunger.item_eat(amt)
|
||||||
else
|
else
|
||||||
return minetest.item_eat(amt)
|
return minetest.item_eat(amt)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user