From 7aa0798644c1fa6370cbb63666f674314cd238b4 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Mon, 29 May 2023 17:11:54 +1000 Subject: [PATCH] Cap throwing scaling (#16923) --- Content.Shared/Throwing/ThrowingSystem.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Content.Shared/Throwing/ThrowingSystem.cs b/Content.Shared/Throwing/ThrowingSystem.cs index 4368dac6b7..16f86438fb 100644 --- a/Content.Shared/Throwing/ThrowingSystem.cs +++ b/Content.Shared/Throwing/ThrowingSystem.cs @@ -15,7 +15,7 @@ public sealed class ThrowingSystem : EntitySystem { public const float ThrowAngularImpulse = 5f; - public const float PushbackDefault = 1f; + public const float PushbackDefault = 2f; /// /// The minimum amount of time an entity needs to be thrown before the timer can be run. @@ -155,9 +155,10 @@ public sealed class ThrowingSystem : EntitySystem { var msg = new ThrowPushbackAttemptEvent(); RaiseLocalEvent(uid, msg); + const float MassLimit = 5f; if (!msg.Cancelled) - _physics.ApplyLinearImpulse(user.Value, -impulseVector * pushbackRatio * physics.Mass, body: userPhysics); + _physics.ApplyLinearImpulse(user.Value, -impulseVector / physics.Mass * pushbackRatio * MathF.Min(MassLimit, physics.Mass), body: userPhysics); } } }