This commit is contained in:
Jackson Lewis
2020-05-02 15:02:52 +01:00
committed by GitHub
parent 08018f5ea8
commit 1f0c72dd28
26 changed files with 6621 additions and 901 deletions

View File

@@ -65,6 +65,14 @@ namespace Content.Server.Throw
var spd = a / (1f / timing.TickRate); // acceleration is applied in 1 tick instead of 1 second, scale appropriately
physComp.LinearVelocity = angle.ToVec() * spd;
if (throwSourceEnt != null)
{
var p = throwSourceEnt.GetComponent<PhysicsComponent>();
var playerAccel = 5 * throwForce / (float) Math.Max(0.001, p.Mass);
p.LinearVelocity = Angle.FromDegrees(angle.Degrees + 180).ToVec()
* playerAccel / (1f / timing.TickRate);
}
}
}
}