|
|
|
@ -850,9 +850,13 @@ fn manage_batches(
|
|
|
|
PlayerState::Rewind => (curr.saturating_add(2), curr.saturating_sub(2)),
|
|
|
|
PlayerState::Rewind => (curr.saturating_add(2), curr.saturating_sub(2)),
|
|
|
|
_ => (*curr, *curr),
|
|
|
|
_ => (*curr, *curr),
|
|
|
|
};
|
|
|
|
};
|
|
|
|
if target_batch_id != new_batch_id {
|
|
|
|
if target_batch_id == 0 || new_batch_id == 0 {
|
|
|
|
if let Some(e_old) = batches.iter().find_map(|(e, b)| (b.0 == target_batch_id).then_some(e)) {
|
|
|
|
// skip
|
|
|
|
commands.entity(e_old).insert(Batch(new_batch_id));
|
|
|
|
} 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));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|