Ench. table : get rid of global matching
This commit is contained in:
parent
7eaea64ce0
commit
e80eeae854
@ -106,7 +106,7 @@ minetest.register_abm({
|
||||
if obj and obj:get_luaentity() then
|
||||
local itemstring = obj:get_luaentity().itemstring:match("([%w_:]+)%s")
|
||||
for _, ing in pairs(ingredients_list) do
|
||||
if itemstring and ing == itemstring:match(ing)
|
||||
if itemstring and itemstring:match(ing)
|
||||
and not minetest.serialize(ingredients):find(itemstring) then
|
||||
ingredients[#ingredients+1] = itemstring
|
||||
end
|
||||
|
@ -80,10 +80,11 @@ end
|
||||
|
||||
local function allowed(tool)
|
||||
for item, _ in pairs(minetest.registered_tools) do
|
||||
for t in item:gmatch("enchanted_"..tool) do
|
||||
if t then return true end
|
||||
end
|
||||
if item:match("enchanted_"..tool) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user