Skip to content

Commit

Permalink
//clearobjects should remove unknown objects
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxionary committed Mar 28, 2024
1 parent 575bfca commit f82ceda
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions worldedit/manipulations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -640,11 +640,8 @@ function worldedit.clear_objects(pos1, pos2)

local function should_delete(obj)
-- Avoid players and WorldEdit entities
if obj:is_player() then
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)
Expand Down Expand Up @@ -691,4 +688,3 @@ function worldedit.clear_objects(pos1, pos2)
end
return count
end

0 comments on commit f82ceda

Please sign in to comment.