1
0
mirror of https://codeberg.org/tenplus1/mobs_redo.git synced 2024-11-13 05:50:17 +01:00

update {eatable} function

This commit is contained in:
tenplus1 2024-07-27 18:28:44 +01:00
parent 79c85e0551
commit ef9f492bad

View File

@ -12,17 +12,17 @@ function mobs.add_eatable(item, hp)
if def then
local grps = def.groups or {}
local groups = table.copy(def.groups) or {}
local txt = " (" ; if hp > 0 then txt = txt .. "+" end
txt = txt .. hp .. " HP)"
grps.eatable = hp ; grps.flammable = 2
groups.eatable = hp ; groups.flammable = 2
if mod_tt_base == nil then
def.description = def.description .. txt
end
minetest.override_item(item, {description = def.description, groups = grps})
minetest.override_item(item, {description = def.description, groups = groups})
end
end