From f8538d11a0b4dba66c3ffe64e6ed0a13c4c1109d Mon Sep 17 00:00:00 2001 From: ChenHuaYou Date: Wed, 6 Mar 2024 17:45:36 +0800 Subject: [PATCH] =?UTF-8?q?Update=20plugin.rs=20=E8=A7=A3=E5=86=B3bar=5Fen?= =?UTF-8?q?tity=E4=B8=8D=E5=AD=98=E5=9C=A8=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/plugin.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/plugin.rs b/src/plugin.rs index e5f1ad5..9c2c5cf 100644 --- a/src/plugin.rs +++ b/src/plugin.rs @@ -181,7 +181,9 @@ fn remove( let Ok(&WithBar(bar_entity, _)) = parent_query.get(entity) else { return; }; - + if commands.get_entity(bar_entity).is_none(){ + return; + } commands.entity(bar_entity).despawn_recursive() }); }