1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-05 18:10:26 +01:00

Redirected register_food to re-define on_use function

- Pasted overwrite's function call
This commit is contained in:
LeMagnesium 2015-04-08 17:10:06 +02:00
parent 43db95e0a7
commit b494d7b990

View File

@ -169,6 +169,11 @@ function hunger.register_food(name, hunger_change, replace_with_item, poisen, he
food[name].poisen = poisen -- time its poisening food[name].poisen = poisen -- time its poisening
food[name].healing = heal -- amount of HP food[name].healing = heal -- amount of HP
food[name].sound = sound -- special sound that is played when eating food[name].sound = sound -- special sound that is played when eating
-- copied overwrite
local def = minetest.registered_items[name]
if not def then return end
def.on_use = hunger.item_eat(hunger_change, replace_with_item, poisen, heal, sound)
minetest.registered_items[name] = def
end end
-- Poison player -- Poison player