summaryrefslogtreecommitdiff
path: root/hunger.lua
diff options
context:
space:
mode:
Diffstat (limited to 'hunger.lua')
-rw-r--r--hunger.lua3
1 files changed, 1 insertions, 2 deletions
diff --git a/hunger.lua b/hunger.lua
index 8bad2e7..badff58 100644
--- a/hunger.lua
+++ b/hunger.lua
@@ -57,8 +57,7 @@ end
local function overwrite(name, hunger_change, replace_with_item, poisen, heal)
local tab = minetest.registered_items[name]
if tab == nil then return end
- tab.on_use = hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal)
- minetest.registered_items[name] = tab
+ minetest.override_item(name, {on_use = hbhunger.item_eat(hunger_change, replace_with_item, poisen, heal) })
end
if minetest.get_modpath("default") ~= nil then