store vehicle parent offset

This commit is contained in:
in0finite 2019-07-13 17:38:07 +02:00
parent c6143c3647
commit 62d6925020
2 changed files with 7 additions and 1 deletions

View file

@ -9,6 +9,8 @@ namespace SanAndreasUnity.Behaviours.Peds.States
public class VehicleSittingState : BaseVehicleState public class VehicleSittingState : BaseVehicleState
{ {
Vector3 m_vehicleParentOffset = Vector3.zero;
public override void OnBecameActive() public override void OnBecameActive()
@ -20,6 +22,7 @@ namespace SanAndreasUnity.Behaviours.Peds.States
public override void OnBecameInactive() public override void OnBecameInactive()
{ {
m_vehicleParentOffset = Vector3.zero;
this.Cleanup(); this.Cleanup();
base.OnBecameInactive(); base.OnBecameInactive();
@ -47,10 +50,11 @@ namespace SanAndreasUnity.Behaviours.Peds.States
{ {
Vehicle vehicle = this.CurrentVehicle; Vehicle vehicle = this.CurrentVehicle;
Vehicle.Seat seat = this.CurrentVehicleSeat; Vehicle.Seat seat = this.CurrentVehicleSeat;
m_vehicleParentOffset = m_model.VehicleParentOffset;
BaseVehicleState.PreparePedForVehicle(m_ped, vehicle, seat); BaseVehicleState.PreparePedForVehicle(m_ped, vehicle, seat);
this.UpdateAnimsWhilePassenger(); //this.UpdateAnimsWhilePassenger();
} }

View file

@ -16,6 +16,8 @@
- sometimes, current vehicle is null on client - sometimes, current vehicle is null on client
- test situation when player connects, and there are peds sitting in vehicles
*** ***
- is weapon sound 3d ? - is weapon sound 3d ?