Skip to content

Commit

Permalink
Update plugin.rs 解决bar_entity不存在问题
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenHuaYou authored Mar 6, 2024
1 parent 4926523 commit f8538d1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,9 @@ fn remove<T: Percentage + Component>(
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()
});
}
Expand Down

0 comments on commit f8538d1

Please sign in to comment.