Fix throwing non-hard entities (#16389)

This commit is contained in:
metalgearsloth
2023-05-13 23:45:59 +10:00
committed by GitHub
parent 636ee85e18
commit 17f217a4a3

View File

@@ -93,7 +93,7 @@ public sealed class ThrowingSystem : EntitySystem
comp.Thrower = user;
// Give it a l'il spin.
if (!tagQuery.TryGetComponent(uid, out var tag) || !_tagSystem.HasTag(tag, "NoSpinOnThrow"))
if (physics.InvI > 0f && (!tagQuery.TryGetComponent(uid, out var tag) || !_tagSystem.HasTag(tag, "NoSpinOnThrow")))
_physics.ApplyAngularImpulse(uid, ThrowAngularImpulse / physics.InvI, body: physics);
else
transform.LocalRotation = direction.ToWorldAngle() - Math.PI;