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
|
if obj and obj:get_luaentity() then
|
||||||
local itemstring = obj:get_luaentity().itemstring:match("([%w_:]+)%s")
|
local itemstring = obj:get_luaentity().itemstring:match("([%w_:]+)%s")
|
||||||
for _, ing in pairs(ingredients_list) do
|
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
|
and not minetest.serialize(ingredients):find(itemstring) then
|
||||||
ingredients[#ingredients+1] = itemstring
|
ingredients[#ingredients+1] = itemstring
|
||||||
end
|
end
|
||||||
|
@ -80,10 +80,11 @@ end
|
|||||||
|
|
||||||
local function allowed(tool)
|
local function allowed(tool)
|
||||||
for item, _ in pairs(minetest.registered_tools) do
|
for item, _ in pairs(minetest.registered_tools) do
|
||||||
for t in item:gmatch("enchanted_"..tool) do
|
if item:match("enchanted_"..tool) then
|
||||||
if t then return true end
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
return false
|
return false
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user