Vehicle seat fix
This commit is contained in:
@ -59,6 +59,7 @@ namespace RageCoop.Client
|
|||||||
{
|
{
|
||||||
var veh = ped.CurrentVehicle?.GetSyncEntity() ?? ped.VehicleTryingToEnter?.GetSyncEntity() ?? ped.LastVehicle?.GetSyncEntity();
|
var veh = ped.CurrentVehicle?.GetSyncEntity() ?? ped.VehicleTryingToEnter?.GetSyncEntity() ?? ped.LastVehicle?.GetSyncEntity();
|
||||||
p.VehicleID = veh?.ID ?? 0;
|
p.VehicleID = veh?.ID ?? 0;
|
||||||
|
if (p.VehicleID==0) { Main.Logger.Error("Invalid vehicle"); }
|
||||||
if (p.Speed==5)
|
if (p.Speed==5)
|
||||||
{
|
{
|
||||||
p.Seat=ped.GetSeatTryingToEnter();
|
p.Seat=ped.GetSeatTryingToEnter();
|
||||||
|
@ -692,7 +692,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
if (!(localRagdoll || MainPed.IsDead))
|
if (!(localRagdoll || MainPed.IsDead))
|
||||||
{
|
{
|
||||||
if (!IsAiming)
|
if (!IsAiming && !MainPed.IsGettingUp)
|
||||||
{
|
{
|
||||||
MainPed.Heading=Heading;
|
MainPed.Heading=Heading;
|
||||||
}
|
}
|
||||||
@ -741,7 +741,7 @@ namespace RageCoop.Client
|
|||||||
#endregion
|
#endregion
|
||||||
private void DisplayInVehicle()
|
private void DisplayInVehicle()
|
||||||
{
|
{
|
||||||
if (CurrentVehicle==null || CurrentVehicle.MainVehicle==null) { return; }
|
if (CurrentVehicle==null || CurrentVehicle.MainVehicle==null) { Main.Logger.Error("Veh not found"); return; }
|
||||||
switch (Speed)
|
switch (Speed)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
|
@ -45,6 +45,18 @@ namespace RageCoop.Client
|
|||||||
public static byte GetPedSpeed(this Ped ped)
|
public static byte GetPedSpeed(this Ped ped)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (ped.IsSittingInVehicle())
|
||||||
|
{
|
||||||
|
return 4;
|
||||||
|
}
|
||||||
|
if (ped.IsTaskActive(TaskType.CTaskEnterVehicle))
|
||||||
|
{
|
||||||
|
return 5;
|
||||||
|
}
|
||||||
|
if (ped.IsTaskActive(TaskType.CTaskExitVehicle))
|
||||||
|
{
|
||||||
|
return 6;
|
||||||
|
}
|
||||||
if (ped.IsWalking)
|
if (ped.IsWalking)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
@ -58,18 +70,6 @@ namespace RageCoop.Client
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ped.IsSittingInVehicle())
|
|
||||||
{
|
|
||||||
return 4;
|
|
||||||
}
|
|
||||||
if (ped.IsTaskActive(TaskType.CTaskEnterVehicle))
|
|
||||||
{
|
|
||||||
return 5;
|
|
||||||
}
|
|
||||||
if (ped.IsTaskActive(TaskType.CTaskExitVehicle))
|
|
||||||
{
|
|
||||||
return 6;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user