remove unnecessary check

This commit is contained in:
yuni 2024-05-22 23:31:57 +02:00
parent 8acbd4f33b
commit 9b48112ee6

View file

@ -429,7 +429,6 @@ pub fn apply_input_to_player(
&mut LinearVelocity, &mut LinearVelocity,
&mut ExternalTorque, &mut ExternalTorque,
Option<&actor::PlayerDrivesThis>, Option<&actor::PlayerDrivesThis>,
Option<&actor::WantsMaxRotation>,
), ),
(With<actor::PlayerCamera>, Without<Camera>), (With<actor::PlayerCamera>, Without<Camera>),
>, >,
@ -458,7 +457,7 @@ pub fn apply_input_to_player(
DVec3::splat(0.0) 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() q_playercam.get_single_mut()
{ {
// Handle key input // 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 settings.rotation_stabilizer_active || key_input.pressed(settings.key_stop) {
if maxrot.is_none() {
commands commands
.entity(player_entity) .entity(player_entity)
.insert(actor::WantsMaxRotation(0.0)); .insert(actor::WantsMaxRotation(0.0));
} } else {
} else if maxrot.is_some() {
commands commands
.entity(player_entity) .entity(player_entity)
.remove::<actor::WantsMaxRotation>(); .remove::<actor::WantsMaxRotation>();