Make //clearobjects remove unknown objects (#244)

This commit is contained in:
fluxionary 2024-03-29 16:17:51 -07:00 committed by GitHub
parent 575bfca67a
commit f75700ed76
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -644,7 +644,7 @@ function worldedit.clear_objects(pos1, pos2)
return false
end
local entity = obj:get_luaentity()
return not entity or not entity.name:find("^worldedit:")
return not (entity and entity.name:find("^worldedit:"))
end
-- Offset positions to include full nodes (positions are in the center of nodes)
@ -691,4 +691,3 @@ function worldedit.clear_objects(pos1, pos2)
end
return count
end