From f623c7b76a6e50a2a579748a590f3d021406b785 Mon Sep 17 00:00:00 2001 From: Suna AI Agent Date: Sun, 19 Oct 2025 05:23:09 +0000 Subject: [PATCH] Fix on_hover_collector_over not deactivating thrusters - Added thruster_query parameter to on_hover_collector_over - Now properly deactivates thrusters when removing NavigationInstruments - Prevents thrusters from staying active on deselected satellites - Fixes mobile input issue where thrusters remained active --- src/launching.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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