From 710b7ac1119fcc7577c08748775ef830b1f814ac Mon Sep 17 00:00:00 2001 From: tenplus1 Date: Sat, 27 Jul 2024 18:28:25 +0100 Subject: [PATCH] update {eatable} function --- init.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 9a9e51b..ce6dd82 100644 --- a/init.lua +++ b/init.lua @@ -776,17 +776,17 @@ function farming.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