mirror of
https://github.com/Uberi/Minetest-WorldEdit.git
synced 2025-07-06 01:50:31 +02:00
//clearobjects should remove unknown objects
This commit is contained in:
@ -640,11 +640,8 @@ function worldedit.clear_objects(pos1, pos2)
|
|||||||
|
|
||||||
local function should_delete(obj)
|
local function should_delete(obj)
|
||||||
-- Avoid players and WorldEdit entities
|
-- Avoid players and WorldEdit entities
|
||||||
if obj:is_player() then
|
|
||||||
return false
|
|
||||||
end
|
|
||||||
local entity = obj:get_luaentity()
|
local entity = obj:get_luaentity()
|
||||||
return not entity or not entity.name:find("^worldedit:")
|
return not (entity and entity.name:find("^worldedit:"))
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Offset positions to include full nodes (positions are in the center of nodes)
|
-- Offset positions to include full nodes (positions are in the center of nodes)
|
||||||
@ -691,4 +688,3 @@ function worldedit.clear_objects(pos1, pos2)
|
|||||||
end
|
end
|
||||||
return count
|
return count
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user