From 9b48112ee6065f8269edf07cc6855562cf7b3204 Mon Sep 17 00:00:00 2001 From: yuni Date: Wed, 22 May 2024 23:31:57 +0200 Subject: [PATCH] remove unnecessary check --- src/camera.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/camera.rs b/src/camera.rs index 0e28705..521020e 100644 --- a/src/camera.rs +++ b/src/camera.rs @@ -429,7 +429,6 @@ pub fn apply_input_to_player( &mut LinearVelocity, &mut ExternalTorque, Option<&actor::PlayerDrivesThis>, - Option<&actor::WantsMaxRotation>, ), (With, Without), >, @@ -458,7 +457,7 @@ pub fn apply_input_to_player( DVec3::splat(0.0) }; - if let Ok((player_entity, player_transform, mut engine, mut v, mut torque, bike, maxrot)) = + if let Ok((player_entity, player_transform, mut engine, mut v, mut torque, bike)) = q_playercam.get_single_mut() { // Handle key input @@ -594,12 +593,10 @@ pub fn apply_input_to_player( } if settings.rotation_stabilizer_active || key_input.pressed(settings.key_stop) { - if maxrot.is_none() { - commands - .entity(player_entity) - .insert(actor::WantsMaxRotation(0.0)); - } - } else if maxrot.is_some() { + commands + .entity(player_entity) + .insert(actor::WantsMaxRotation(0.0)); + } else { commands .entity(player_entity) .remove::();