summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-05 14:28:19 +0200
committerWuzzy <almikes@aol.com>2016-08-05 14:28:19 +0200
commitbe3d491cf8e44ac1943747729cdb90311a08ae87 (patch)
tree3f5931eabe6e1593977366e443f395f9a59ee2da
parentf028f6c8d823fbb3db9f9177fef8586a8f096d45 (diff)
Use minetest.override_item
-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