From 63491e76eaf9343171131f21d52abfd60e08f4d8 Mon Sep 17 00:00:00 2001 From: in0finite Date: Mon, 29 Apr 2019 00:37:00 +0200 Subject: [PATCH] Working on vehicle sync 4 --- .../Behaviours/Ped/States/VehicleSittingState.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Assets/Scripts/Behaviours/Ped/States/VehicleSittingState.cs b/Assets/Scripts/Behaviours/Ped/States/VehicleSittingState.cs index e7fb2da6..a195a1da 100644 --- a/Assets/Scripts/Behaviours/Ped/States/VehicleSittingState.cs +++ b/Assets/Scripts/Behaviours/Ped/States/VehicleSittingState.cs @@ -10,9 +10,11 @@ namespace SanAndreasUnity.Behaviours.Peds.States { - public override void OnBecameActive() { + public override void OnBecameInactive() + { + base.OnBecameInactive(); } public void EnterVehicle(Vehicle vehicle, Vehicle.Seat seat) @@ -35,10 +37,14 @@ namespace SanAndreasUnity.Behaviours.Peds.States } - public override void OnSubmitPressed() { - + public override void OnSubmitPressed() + { // exit the vehicle - m_ped.ExitVehicle(); + + if (m_isServer) + m_ped.ExitVehicle(); + else + base.OnSubmitPressed(); } @@ -46,6 +52,8 @@ namespace SanAndreasUnity.Behaviours.Peds.States base.UpdateState(); + // check if this is still active state ? + if (m_ped.IsDrivingVehicle) this.UpdateWheelTurning ();