diff --git a/src/actor.rs b/src/actor.rs index 9917d6b..543b293 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -562,7 +562,7 @@ fn handle_cheats( key_input: Res>, mut q_player: Query<(&Transform, &mut Position, &mut LinearVelocity), With>, mut q_life: Query<(&mut actor::LifeForm, &mut actor::ExperiencesGForce), With>, - q_target: Query<(&Transform, &Position, &LinearVelocity), (With, Without)>, + q_target: Query<(&Transform, &Position, Option<&LinearVelocity>), (With, Without)>, mut ew_playerdies: EventWriter, mut settings: ResMut, id2pos: Res, @@ -604,7 +604,9 @@ fn handle_cheats( if let Ok((transform, target_pos, target_v)) = q_target.get_single() { let offset: DVec3 = 4.0 * (**pos - **target_pos).normalize() * transform.scale.as_dvec3(); pos.0 = **target_pos + offset; - *v = target_v.clone(); + if let Some(target_v) = target_v { + *v = target_v.clone(); + } } }