From 76aeb8dcaf4bec7a22389386bf7f60571762d4cf Mon Sep 17 00:00:00 2001 From: Elijah Voigt Date: Sun, 10 Aug 2025 05:42:59 -0700 Subject: [PATCH] Fixed 0th index having pipes after rewinding to that spot --- src/bin/flappy/main.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/bin/flappy/main.rs b/src/bin/flappy/main.rs index 82cf8b0..d0f1792 100644 --- a/src/bin/flappy/main.rs +++ b/src/bin/flappy/main.rs @@ -850,9 +850,13 @@ fn manage_batches( PlayerState::Rewind => (curr.saturating_add(2), curr.saturating_sub(2)), _ => (*curr, *curr), }; - if target_batch_id != new_batch_id { - if let Some(e_old) = batches.iter().find_map(|(e, b)| (b.0 == target_batch_id).then_some(e)) { - commands.entity(e_old).insert(Batch(new_batch_id)); + if target_batch_id == 0 || new_batch_id == 0 { + // skip + } else { + if target_batch_id != new_batch_id { + if let Some(e_old) = batches.iter().find_map(|(e, b)| (b.0 == target_batch_id).then_some(e)) { + commands.entity(e_old).insert(Batch(new_batch_id)); + } } } };