From f82ceda766d0e1ad15e4834ab86faa65a1ede6c0 Mon Sep 17 00:00:00 2001 From: flux <25628292+fluxionary@users.noreply.github.com> Date: Wed, 27 Mar 2024 18:50:21 -0700 Subject: [PATCH] //clearobjects should remove unknown objects --- worldedit/manipulations.lua | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/worldedit/manipulations.lua b/worldedit/manipulations.lua index ce13b46..66a1a78 100644 --- a/worldedit/manipulations.lua +++ b/worldedit/manipulations.lua @@ -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) @@ -691,4 +688,3 @@ function worldedit.clear_objects(pos1, pos2) end return count end -