Content update for ECS physics (#13291)
This commit is contained in:
@@ -60,7 +60,7 @@ public sealed class ThrowingSystem : EntitySystem
|
||||
comp.Thrower = user;
|
||||
// Give it a l'il spin.
|
||||
if (!_tagSystem.HasTag(uid, "NoSpinOnThrow"))
|
||||
_physics.ApplyAngularImpulse(physics, ThrowAngularImpulse);
|
||||
_physics.ApplyAngularImpulse(uid, ThrowAngularImpulse, body: physics);
|
||||
else
|
||||
{
|
||||
if (transform == null)
|
||||
@@ -75,7 +75,7 @@ public sealed class ThrowingSystem : EntitySystem
|
||||
_interactionSystem.ThrownInteraction(user.Value, uid);
|
||||
|
||||
var impulseVector = direction.Normalized * strength * physics.Mass;
|
||||
_physics.ApplyLinearImpulse(physics, impulseVector);
|
||||
_physics.ApplyLinearImpulse(uid, impulseVector, body: physics);
|
||||
|
||||
// Estimate time to arrival so we can apply OnGround status and slow it much faster.
|
||||
var time = (direction / strength).Length;
|
||||
@@ -109,7 +109,7 @@ public sealed class ThrowingSystem : EntitySystem
|
||||
RaiseLocalEvent(physics.Owner, msg);
|
||||
|
||||
if (!msg.Cancelled)
|
||||
_physics.ApplyLinearImpulse(userPhysics, -impulseVector * pushbackRatio);
|
||||
_physics.ApplyLinearImpulse(user.Value, -impulseVector * pushbackRatio, body: userPhysics);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user