Skip to content

Commit

Permalink
fix: don't despawn non-existing bar
Browse files Browse the repository at this point in the history
  • Loading branch information
sparten11740 committed Mar 21, 2024
1 parent 64100f8 commit 7261712
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ fn remove<T: Percentage + Component>(
return;
};

if commands.get_entity(bar_entity).is_none() {
return;
}

commands.entity(bar_entity).despawn_recursive()
});
}
Expand Down

0 comments on commit 7261712

Please sign in to comment.