summaryrefslogtreecommitdiff
path: root/src/cell.rs
diff options
context:
space:
mode:
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() {