Fix jetpack assert (#14752)
This commit is contained in:
@@ -75,8 +75,9 @@ namespace Content.Client.Physics.Controllers
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var physicsUid = player;
|
||||||
PhysicsComponent? body;
|
PhysicsComponent? body;
|
||||||
TransformComponent? xformMover = xform;
|
var xformMover = xform;
|
||||||
|
|
||||||
if (mover.ToParent && HasComp<RelayInputMoverComponent>(xform.ParentUid))
|
if (mover.ToParent && HasComp<RelayInputMoverComponent>(xform.ParentUid))
|
||||||
{
|
{
|
||||||
@@ -85,6 +86,8 @@ namespace Content.Client.Physics.Controllers
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
physicsUid = xform.ParentUid;
|
||||||
}
|
}
|
||||||
else if (!TryComp(player, out body))
|
else if (!TryComp(player, out body))
|
||||||
{
|
{
|
||||||
@@ -128,7 +131,7 @@ namespace Content.Client.Physics.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Server-side should just be handled on its own so we'll just do this shizznit
|
// Server-side should just be handled on its own so we'll just do this shizznit
|
||||||
HandleMobMovement(player, mover, body, xformMover, frameTime, xformQuery, moverQuery, relayTargetQuery);
|
HandleMobMovement(player, mover, physicsUid, body, xformMover, frameTime, xformQuery, moverQuery, relayTargetQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool CanSound()
|
protected override bool CanSound()
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ namespace Content.Server.Physics.Controllers
|
|||||||
foreach (var mover in EntityQuery<InputMoverComponent>(true))
|
foreach (var mover in EntityQuery<InputMoverComponent>(true))
|
||||||
{
|
{
|
||||||
var uid = mover.Owner;
|
var uid = mover.Owner;
|
||||||
|
EntityUid physicsUid = uid;
|
||||||
|
|
||||||
if (relayQuery.HasComponent(uid))
|
if (relayQuery.HasComponent(uid))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
@@ -87,13 +89,15 @@ namespace Content.Server.Physics.Controllers
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
physicsUid = xform.ParentUid;
|
||||||
}
|
}
|
||||||
else if (!bodyQuery.TryGetComponent(uid, out body))
|
else if (!bodyQuery.TryGetComponent(uid, out body))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleMobMovement(uid, mover, body, xformMover, frameTime, xformQuery, moverQuery, relayTargetQuery);
|
HandleMobMovement(uid, mover, physicsUid, body, xformMover, frameTime, xformQuery, moverQuery, relayTargetQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
HandleShuttleMovement(frameTime);
|
HandleShuttleMovement(frameTime);
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ namespace Content.Shared.Movement.Systems
|
|||||||
protected void HandleMobMovement(
|
protected void HandleMobMovement(
|
||||||
EntityUid uid,
|
EntityUid uid,
|
||||||
InputMoverComponent mover,
|
InputMoverComponent mover,
|
||||||
|
EntityUid physicsUid,
|
||||||
PhysicsComponent physicsComponent,
|
PhysicsComponent physicsComponent,
|
||||||
TransformComponent xform,
|
TransformComponent xform,
|
||||||
float frameTime,
|
float frameTime,
|
||||||
@@ -230,7 +231,7 @@ namespace Content.Shared.Movement.Systems
|
|||||||
|
|
||||||
UsedMobMovement[uid] = true;
|
UsedMobMovement[uid] = true;
|
||||||
// Specifically don't use mover.Owner because that may be different to the actual physics body being moved.
|
// 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 (walkDir, sprintDir) = GetVelocityInput(mover);
|
||||||
var touching = false;
|
var touching = false;
|
||||||
|
|
||||||
@@ -336,10 +337,10 @@ namespace Content.Shared.Movement.Systems
|
|||||||
if (!weightless || touching)
|
if (!weightless || touching)
|
||||||
Accelerate(ref velocity, in worldTotal, accel, frameTime);
|
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
|
// 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)
|
private void Friction(float minimumFrictionSpeed, float frameTime, float friction, ref Vector2 velocity)
|
||||||
|
|||||||
Reference in New Issue
Block a user