From 90ae953747a746cc32b20bc1cf4cf73cd21ce8c0 Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sun, 25 Oct 2026 10:21:48 +0100 Subject: [PATCH] Rockets: collapse the boost's nested if (clippy::collapsible_if) Verify failed on it with warnings denied. Co-Authored-By: Claude Opus 5.5 --- .../src/game/remote_projectiles.rs | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/crates/horizon-client/src/game/remote_projectiles.rs b/crates/horizon-client/src/game/remote_projectiles.rs index dbf7f3ccf..056efa7c3 100644 --- a/crates/horizon-client/src/game/remote_projectiles.rs +++ b/crates/horizon-client/src/game/remote_projectiles.rs @@ -239,20 +239,20 @@ impl Game<'_> { for r in &mut self.rockets { let id = r.id; r.remote_step(|at| step(id, at)); - if me.is_some() && r.attached_to == me { - if let Some(p) = self.player.as_mut() - && p.fall_flying - { - let look = view_vector(self.yaw, self.pitch); - let m = p.velocity; - p.velocity = Vec3::new( - m.x + look[0] * 0.1 + (look[0] * 1.5 - m.x) * 0.5, - m.y + look[1] * 0.1 + (look[1] * 1.5 - m.y) * 0.5, - m.z + look[2] * 0.1 + (look[2] * 1.5 - m.z) * 0.5, - ); - r.position = p.position; - r.velocity = p.velocity; - } + if me.is_some() + && r.attached_to == me + && let Some(p) = self.player.as_mut() + && p.fall_flying + { + let look = view_vector(self.yaw, self.pitch); + let m = p.velocity; + p.velocity = Vec3::new( + m.x + look[0] * 0.1 + (look[0] * 1.5 - m.x) * 0.5, + m.y + look[1] * 0.1 + (look[1] * 1.5 - m.y) * 0.5, + m.z + look[2] * 0.1 + (look[2] * 1.5 - m.z) * 0.5, + ); + r.position = p.position; + r.velocity = p.velocity; } } for c in &mut self.crystals {