diff --git a/src/actor.rs b/src/actor.rs index 8b515ec..55be08f 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -310,16 +310,22 @@ pub fn handle_vehicle_enter_exit( fn handle_collisions( mut collision_event_reader: EventReader, mut ew_sfx: EventWriter, - q_player: Query>, + q_player: Query<(Entity, Option<&Player>), With>, mut q_player_lifeform: Query<(&mut LifeForm, &mut Suit, &mut HitPoints), With>, ) { - if let (Ok(player), Ok((mut lifeform, mut suit, mut hp))) = (q_player.get_single(), q_player_lifeform.get_single_mut()) { + if let (Ok((player, player_maybe)), Ok((mut lifeform, mut suit, mut hp))) = (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; - suit.integrity -= 0.03; - hp.damage += 10.0; + + if player_maybe.is_some() { + suit.integrity -= 0.03; + hp.damage += 10.0; + } + else { + hp.damage += 3.0; + } } } }