diff --git a/src/actor.rs b/src/actor.rs index 17964a9..a567401 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -40,7 +40,7 @@ impl Plugin for ActorPlugin { update_power.run_if(game_running), handle_gravity.run_if(game_running), handle_wants_rotation.run_if(game_running), - handle_wants_acceleration.run_if(game_running), + handle_wants_acceleration.run_if(game_running).run_if(alive), handle_wants_maxrotation.run_if(game_running), handle_wants_maxvelocity .run_if(game_running) @@ -231,7 +231,7 @@ pub enum EngineType { Ion, } -#[derive(Component)] +#[derive(Component, Copy, Clone)] pub struct Engine { pub thrust_forward: f32, pub thrust_back: f32, @@ -588,7 +588,9 @@ pub fn handle_vehicle_enter_exit( commands.entity(driver).remove::(); commands.entity(driver).remove::(); commands.entity(driver).insert(JustNowEnteredVehicle); - commands.entity(vehicle).insert(WantsAcceleration::default()); + commands + .entity(vehicle) + .insert(WantsAcceleration::default()); commands.entity(vehicle).remove::(); commands.entity(vehicle).insert(PlayerCamera); commands.entity(vehicle).insert(PlayerDrivesThis); @@ -722,23 +724,29 @@ fn handle_wants_rotation(mut q_actor: Query<(&mut Rotation, &WantsRotation)>) { } fn handle_wants_acceleration( + time: Res