mirror of
https://codeberg.org/tenplus1/farming.git
synced 2024-12-27 03:00:20 +01:00
update {eatable} function
This commit is contained in:
parent
b61998217d
commit
710b7ac111
6
init.lua
6
init.lua
@ -776,17 +776,17 @@ function farming.add_eatable(item, hp)
|
|||||||
|
|
||||||
if def then
|
if def then
|
||||||
|
|
||||||
local grps = def.groups or {}
|
local groups = table.copy(def.groups) or {}
|
||||||
local txt = " (" ; if hp > 0 then txt = txt .. "+" end
|
local txt = " (" ; if hp > 0 then txt = txt .. "+" end
|
||||||
txt = txt .. hp .. " HP)"
|
txt = txt .. hp .. " HP)"
|
||||||
|
|
||||||
grps.eatable = hp ; grps.flammable = 2
|
groups.eatable = hp ; groups.flammable = 2
|
||||||
|
|
||||||
if mod_tt_base == nil then
|
if mod_tt_base == nil then
|
||||||
def.description = def.description .. txt
|
def.description = def.description .. txt
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.override_item(item, {description = def.description, groups = grps})
|
minetest.override_item(item, {description = def.description, groups = groups})
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user