remember time when seat's ped changed

This commit is contained in:
in0finite 2020-05-07 17:58:47 +02:00
parent cff2be9531
commit a68efa0b7d
2 changed files with 5 additions and 0 deletions

View file

@ -400,6 +400,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
return;
m_lastPreparedPeds[index] = ped;
seat.TimeWhenPedChanged = Time.time;
this.OnPedAssignedToVehicle_Radio(ped, seat);
@ -416,6 +417,7 @@ namespace SanAndreasUnity.Behaviours.Vehicles
int index = this.Seats.FindIndex(s => s == seat);
m_lastPreparedPeds[index] = null;
seat.TimeWhenPedChanged = Time.time;
}

View file

@ -239,6 +239,9 @@ namespace SanAndreasUnity.Behaviours.Vehicles
/// <summary> Ped that is occupying this seat. </summary>
public Ped OccupyingPed { get; internal set; }
public float TimeWhenPedChanged { get; internal set; } = float.NegativeInfinity;
public float TimeSincePedChanged => Time.time - this.TimeWhenPedChanged;
public bool IsTaken { get { return this.OccupyingPed != null; } }
public bool IsLeftHand