mirror of
https://github.com/sys4-fr/server-nalc.git
synced 2024-11-18 16:20:38 +01:00
Redirected register_food to re-define on_use function
- Pasted overwrite's function call
This commit is contained in:
parent
43db95e0a7
commit
b494d7b990
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user