Fix jetpack assert (#14752)

This commit is contained in:
metalgearsloth
2023-03-22 15:58:53 +11:00
committed by GitHub
parent 4151b31b31
commit 5823e47442
3 changed files with 14 additions and 6 deletions

View File

@@ -102,6 +102,7 @@ namespace Content.Shared.Movement.Systems
protected void HandleMobMovement(
EntityUid uid,
InputMoverComponent mover,
EntityUid physicsUid,
PhysicsComponent physicsComponent,
TransformComponent xform,
float frameTime,
@@ -230,7 +231,7 @@ namespace Content.Shared.Movement.Systems
UsedMobMovement[uid] = true;
// Specifically don't use mover.Owner because that may be different to the actual physics body being moved.
var weightless = _gravity.IsWeightless(uid, physicsComponent, xform);
var weightless = _gravity.IsWeightless(physicsUid, physicsComponent, xform);
var (walkDir, sprintDir) = GetVelocityInput(mover);
var touching = false;
@@ -336,10 +337,10 @@ namespace Content.Shared.Movement.Systems
if (!weightless || touching)
Accelerate(ref velocity, in worldTotal, accel, frameTime);
PhysicsSystem.SetLinearVelocity(uid, velocity, body: physicsComponent);
PhysicsSystem.SetLinearVelocity(physicsUid, velocity, body: physicsComponent);
// Ensures that players do not spiiiiiiin
PhysicsSystem.SetAngularVelocity(uid, 0, body: physicsComponent);
PhysicsSystem.SetAngularVelocity(physicsUid, 0, body: physicsComponent);
}
private void Friction(float minimumFrictionSpeed, float frameTime, float friction, ref Vector2 velocity)