mirror of
https://github.com/minetest-mods/MoreMesecons.git
synced 2024-08-20 05:04:09 +02:00
Add a functionnality to the entity detector to detect builtin items
This commit is contained in:
parent
f42f6a4bd9
commit
d77d77e451
@ -40,9 +40,10 @@ local object_detector_scan = function (pos)
|
|||||||
end
|
end
|
||||||
for _,obj in pairs(minetest.get_objects_inside_radius(pos, radius)) do
|
for _,obj in pairs(minetest.get_objects_inside_radius(pos, radius)) do
|
||||||
if not obj:is_player() then
|
if not obj:is_player() then
|
||||||
local isname = (obj:get_luaentity()).name
|
local luaentity = obj:get_luaentity()
|
||||||
|
local isname = luaentity.name
|
||||||
if isname
|
if isname
|
||||||
and (scan_all or isname == scanname) then -- entity with scanname found or not scanname specified
|
and (scan_all or isname == scanname or (isname == "__builtin:item" and luaentity.itemstring == scanname)) then -- entity with scanname found or not scanname specified
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user