diff --git a/src/launching.rs b/src/launching.rs index 046a010..3043a74 100644 --- a/src/launching.rs +++ b/src/launching.rs @@ -361,15 +361,20 @@ fn on_hover_collector_over( ev: On>, mut commands: Commands, query: Query>, + mut thruster_query: Query<&mut Thruster>, ) { // Hover only indicates potential selection; do not modify thrusters here //println!("hover over collector {:?}", ev.entity); commands.entity(ev.entity).insert(NavigationInstruments); - // Remove selection marker from others + // Remove selection marker from others and deactivate their thrusters for entity in query.iter() { if entity != ev.entity { commands.entity(entity).remove::(); + // Deactivate thruster when removing navigation instruments + if let Ok(mut thruster) = thruster_query.get_mut(entity) { + thruster.active = false; + } } } } @@ -528,5 +533,4 @@ fn sun_thruster_touch( _ => {} } } -} - +} \ No newline at end of file