From a0207d6b7a53fd942f9010287d27336692893da4 Mon Sep 17 00:00:00 2001 From: Tom Barrett Date: Mon, 6 Mar 2023 21:51:36 +0100 Subject: bevy 10 --- src/cell.rs | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src/cell.rs') diff --git a/src/cell.rs b/src/cell.rs index 7c2385d..0d9b381 100644 --- a/src/cell.rs +++ b/src/cell.rs @@ -115,11 +115,7 @@ impl Cell { ) { self.occupant = occupant; sprite.index = self.occupant.to_index(); - if self.occupant == Occupant::None { - visibility.is_visible = false; - } else { - visibility.is_visible = true; - } + *visibility = Visibility::Inherited; } } @@ -187,7 +183,7 @@ pub fn check(mut q: Query<(&mut Cell, &mut TextureAtlasSprite, &mut Visibility)> last = Occupant::None; } - connected = connected.into_iter().filter(|c| c.len() > 4).collect(); + connected.retain(|c| c.len() > 4); for c in connected.iter() { for (i, j) in c.iter() { -- cgit v1.2.3