Skip to content

Commit

Permalink
Make //clearobjects remove unknown objects (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
fluxionary authored Mar 29, 2024
1 parent 575bfca commit f75700e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions worldedit/manipulations.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -691,4 +691,3 @@ function worldedit.clear_objects(pos1, pos2)
end
return count
end

0 comments on commit f75700e

Please sign in to comment.