From 5597411bacd89e9c17321bfd0f8c394c7a886683 Mon Sep 17 00:00:00 2001 From: yuni Date: Thu, 3 Oct 2024 06:26:06 +0200 Subject: [PATCH] infinite energy inside vehicles --- src/actor.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/actor.rs b/src/actor.rs index 44390f9..42b3895 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -281,13 +281,15 @@ pub fn update_power( prefs: Res, mut q_battery: Query<(&mut Battery, &mut Engine), With>, mut q_flashlight: Query<&mut Visibility, With>, + q_bike: Query<&PlayerDrivesThis>, mut ew_sfx: EventWriter, mut ew_game: EventWriter, ) { let mut power_down = false; let d = time.delta_seconds(); + let inside_vehicle = !q_bike.is_empty(); for (mut battery, mut engine) in &mut q_battery { - if !settings.god_mode { + if !inside_vehicle && !settings.god_mode { if settings.flashlight_active { battery.power -= POWER_DRAIN_FLASHLIGHT[prefs.flashlight_power] * d; // 2.4MW if battery.power <= 0.0 {