diff --git a/src/actor.rs b/src/actor.rs index be89640..8cf498b 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -588,6 +588,7 @@ pub fn handle_vehicle_enter_exit( commands.entity(driver).remove::(); commands.entity(driver).remove::(); commands.entity(driver).remove::(); + commands.entity(driver).remove::(); commands.entity(driver).insert(JustNowEnteredVehicle); commands .entity(vehicle) @@ -595,6 +596,7 @@ pub fn handle_vehicle_enter_exit( commands.entity(vehicle).remove::(); commands.entity(vehicle).insert(PlayerCamera); commands.entity(vehicle).insert(PlayerDrivesThis); + commands.entity(vehicle).insert(WantsMaxRotation(0.0)); if let Ok(mut flashlight_trans) = q_playerflashlight.get_single_mut() { flashlight_trans.rotation = Quat::from_rotation_y(0f32); flashlight_trans.translation = Vec3::new(0.0, 0.0, 0.0); @@ -614,11 +616,15 @@ pub fn handle_vehicle_enter_exit( Quat::from_rotation_y(180f32.to_radians()); flashlight_trans.translation = Vec3::new(0.0, 0.0, 1.0); } + commands.entity(driver).insert(WantsAcceleration::default()); commands.entity(driver).insert(RigidBody::Dynamic); ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::ExitVehicle)); + commands.entity(vehicle).remove::(); commands.entity(vehicle).remove::(); commands.entity(driver).insert(PlayerCamera); commands.entity(vehicle).remove::(); + commands.entity(vehicle).remove::(); + commands.entity(vehicle).remove::(); *vehicle_vis = Visibility::Visible; } }