diff --git a/src/actor.rs b/src/actor.rs index 1719fb1..ed11b42 100644 --- a/src/actor.rs +++ b/src/actor.rs @@ -180,6 +180,8 @@ pub struct ActorEnteringVehicle; #[derive(Component)] pub struct ActorVehicleBeingEntered; #[derive(Component)] +pub struct HiddenInsideVehicle; +#[derive(Component)] pub struct MessageOnVehicleEntry(pub String); #[derive(Component)] pub struct PlayersFlashLight; @@ -597,6 +599,7 @@ pub fn handle_vehicle_enter_exit( commands.entity(driver).remove::(); commands.entity(driver).remove::(); commands.entity(driver).insert(JustNowEnteredVehicle); + commands.entity(driver).insert(HiddenInsideVehicle); commands .entity(vehicle) .insert(WantsAcceleration::default()); @@ -623,6 +626,7 @@ 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).remove::(); commands.entity(driver).insert(WantsAcceleration::default()); commands.entity(driver).insert(RigidBody::Dynamic); ew_sfx.send(audio::PlaySfxEvent(audio::Sfx::ExitVehicle)); @@ -771,7 +775,7 @@ fn handle_wants_acceleration( Option<&hud::IsTargeted>, Option<&PlayerCamera>, ), - Without, + (Without, Without), >, mut ew_effect: EventWriter, ) {