From f75700ed761653789a0da9d9c1c060bc7214e9bc Mon Sep 17 00:00:00 2001 From: fluxionary <25628292+fluxionary@users.noreply.github.com> Date: Fri, 29 Mar 2024 16:17:51 -0700 Subject: [PATCH] Make //clearobjects remove unknown objects (#244) --- worldedit/manipulations.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/worldedit/manipulations.lua b/worldedit/manipulations.lua index ce13b46..f45aa1e 100644 --- a/worldedit/manipulations.lua +++ b/worldedit/manipulations.lua @@ -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 -