From d4c8ca231a8d55b20641d54da7dcd1cd611fe340 Mon Sep 17 00:00:00 2001 From: yuni Date: Sun, 17 Nov 2024 01:54:47 +0100 Subject: [PATCH] WIP crisper camera controls (fix match velocity in vehicles) --- src/actor.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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, ) {