Ped movement change
This commit is contained in:
@ -640,6 +640,7 @@ namespace RageCoop.Client
|
|||||||
private bool LastMoving;
|
private bool LastMoving;
|
||||||
private void WalkTo()
|
private void WalkTo()
|
||||||
{
|
{
|
||||||
|
Function.Call(Hash.SET_PED_STEALTH_MOVEMENT, MainPed, IsInStealthMode, 0);
|
||||||
Vector3 predictPosition = Position + (Position - MainPed.Position) + Velocity * 0.5f;
|
Vector3 predictPosition = Position + (Position - MainPed.Position) + Velocity * 0.5f;
|
||||||
float range = predictPosition.DistanceToSquared(MainPed.Position);
|
float range = predictPosition.DistanceToSquared(MainPed.Position);
|
||||||
|
|
||||||
@ -696,19 +697,21 @@ namespace RageCoop.Client
|
|||||||
MainPed.PositionNoOffset=Position;
|
MainPed.PositionNoOffset=Position;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var f = dist*(Position+SyncParameters.PositioinPredictionDefault*Velocity-MainPed.Position)+(Velocity-MainPed.Velocity)*0.2f;
|
// var f = dist*(Position+SyncParameters.PositioinPredictionDefault*Velocity-MainPed.Position)+(Velocity-MainPed.Velocity)*0.2f;
|
||||||
if (!localRagdoll) { f*=5; }
|
// if (!localRagdoll) { f*=5; }
|
||||||
if (!(localRagdoll|| MainPed.IsDead))
|
if (!(localRagdoll|| MainPed.IsDead))
|
||||||
{
|
{
|
||||||
MainPed.Rotation=Rotation;
|
MainPed.Heading=Heading;
|
||||||
if (MainPed.Speed<0.05) { f*=10; MainPed.Heading=Heading; }
|
MainPed.Velocity=Velocity+5*dist*(Position-MainPed.Position);
|
||||||
|
// if (MainPed.Speed<0.05) { f*=10; MainPed.Heading=Heading; }
|
||||||
}
|
}
|
||||||
else if (Main.Ticked-_lastRagdollTime<10)
|
else if (Main.Ticked-_lastRagdollTime<20)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
MainPed.ApplyForce(f);
|
// MainPed.ApplyForce(f);
|
||||||
}
|
}
|
||||||
|
|
||||||
private string LoadAnim(string anim)
|
private string LoadAnim(string anim)
|
||||||
{
|
{
|
||||||
ulong startTime = Util.GetTickCount64();
|
ulong startTime = Util.GetTickCount64();
|
||||||
|
@ -180,6 +180,7 @@ namespace RageCoop.Client
|
|||||||
// Main.Logger.Debug($"Removing ped {c.ID}. Reason:{reason}");
|
// Main.Logger.Debug($"Removing ped {c.ID}. Reason:{reason}");
|
||||||
p.AttachedBlip?.Delete();
|
p.AttachedBlip?.Delete();
|
||||||
p.Kill();
|
p.Kill();
|
||||||
|
p.Model.MarkAsNoLongerNeeded();
|
||||||
p.MarkAsNoLongerNeeded();
|
p.MarkAsNoLongerNeeded();
|
||||||
p.Delete();
|
p.Delete();
|
||||||
}
|
}
|
||||||
@ -245,6 +246,7 @@ namespace RageCoop.Client
|
|||||||
}
|
}
|
||||||
// Main.Logger.Debug($"Removing vehicle {v.ID}. Reason:{reason}");
|
// Main.Logger.Debug($"Removing vehicle {v.ID}. Reason:{reason}");
|
||||||
veh.AttachedBlip?.Delete();
|
veh.AttachedBlip?.Delete();
|
||||||
|
veh.Model.MarkAsNoLongerNeeded();
|
||||||
veh.MarkAsNoLongerNeeded();
|
veh.MarkAsNoLongerNeeded();
|
||||||
veh.Delete();
|
veh.Delete();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user