summaryrefslogtreecommitdiff
path: root/src/cell.rs
diff options
context:
space:
mode:
authorTom Barrett <tom@tombarrett.xyz>2023-03-06 21:51:36 +0100
committerTom Barrett <tom@tombarrett.xyz>2023-03-06 21:51:36 +0100
commita0207d6b7a53fd942f9010287d27336692893da4 (patch)
tree310452333dd87bfa9b670ffbdc956a83802a2b0b /src/cell.rs
parentff2f897520704adacc8287b3499167bbcf56deb8 (diff)
bevy 10
Diffstat (limited to 'src/cell.rs')
-rw-r--r--src/cell.rs8
1 files changed, 2 insertions, 6 deletions
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() {