From 0c1393290e9201fc709f95a8a5042ec6c3f34452 Mon Sep 17 00:00:00 2001 From: hut Date: Tue, 7 May 2024 19:07:28 +0200 Subject: [PATCH] fix suit damage on collisions outside of vehicles --- src/actor.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/actor.rs b/src/actor.rs index 783df2a..abef7c7 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -391,18 +391,15 @@ pub fn handle_vehicle_enter_exit( fn handle_collisions( mut collision_event_reader: EventReader, mut ew_sfx: EventWriter, - q_player: Query<(Entity, Option<&Player>), With>, + q_player: Query>, mut q_player_lifeform: Query<(&mut LifeForm, &mut Suit), With>, ) { - if let (Ok((player, player_maybe)), Ok((mut lifeform, mut suit))) = (q_player.get_single(), q_player_lifeform.get_single_mut()) { + if let (Ok(player), Ok((mut lifeform, mut suit))) = (q_player.get_single(), q_player_lifeform.get_single_mut()) { for CollisionStarted(entity1, entity2) in collision_event_reader.read() { if *entity1 == player || *entity2 == player { ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::Crash)); lifeform.adrenaline_jolt += 0.1; - - if player_maybe.is_some() { - suit.integrity -= 0.03; - } + suit.integrity -= 0.03; } } }