From 8172af80842cdb9c71d33b2793eb8993b2da54bd Mon Sep 17 00:00:00 2001 From: yuni Date: Thu, 3 Oct 2024 06:48:03 +0200 Subject: [PATCH] auto-disable reactor overload inside vehicles (as there's infinite power anyway) --- src/actor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/actor.rs b/src/actor.rs index 42b3895..8c0da7f 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -355,8 +355,10 @@ pub fn update_physics_lifeforms( &Position, Option<&Player>, )>, + q_bike: Query<&PlayerDrivesThis>, ) { let d = time.delta_seconds(); + let inside_vehicle = !q_bike.is_empty(); for (mut lifeform, mut hp, mut suit, velocity, pos, player) in query.iter_mut() { if lifeform.adrenaline_jolt.abs() > 1e-3 { lifeform.adrenaline_jolt *= 0.99; @@ -371,7 +373,7 @@ pub fn update_physics_lifeforms( (lifeform.adrenaline - 0.0001 + lifeform.adrenaline_jolt * 0.01).clamp(0.0, 1.0); if player.is_some() { - lifeform.is_radioactively_damaged = if settings.reactor_state == 2 { + lifeform.is_radioactively_damaged = if !inside_vehicle && settings.reactor_state == 2 { true } else if let Some(pos_jupiter) = id2pos.0.get(cmd::ID_JUPITER) { pos_jupiter.distance(pos.0) < 140_000_000.0