From 224e0ce2c98853cca04001c559671ff034a8aa9e Mon Sep 17 00:00:00 2001 From: yuni Date: Thu, 23 May 2024 01:26:24 +0200 Subject: [PATCH] cleanup, add TODO --- src/actor.rs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/actor.rs b/src/actor.rs index 1be6464..2e2894b 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -560,13 +560,7 @@ fn handle_wants_maxvelocity( } fn handle_wants_lookat( - mut query: Query<( - &Position, - &mut Rotation, - &Transform, - &mut ExternalTorque, - &WantsToLookAt, - )>, + mut query: Query<(&Position, &mut Rotation, &Transform, &WantsToLookAt)>, q_playercam: Query<&Position, With>, id2pos: Res, ) { @@ -577,7 +571,8 @@ fn handle_wants_lookat( return; }; - for (pos, mut rot, trans, mut _torque, target_id) in &mut query { + // TODO: use ExternalTorque rather than hard-resetting the rotation + for (pos, mut rot, trans, target_id) in &mut query { let target_pos = if target_id.0 == cmd::ID_SPECIAL_PLAYERCAM { player_pos } else if let Some(target_pos) = id2pos.0.get(&target_id.0) {