* Some stuff

* Fix NaN angular velocity

* Optimise a bit

* Give throwing a bit of a spin

* Reality can be whatever I want

* Biffing it

* Cleanup

* Update submodule

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2021-03-30 21:43:03 +11:00
committed by GitHub
parent 72292a98eb
commit d1e4bb0304
56 changed files with 286 additions and 246 deletions

View File

@@ -12,6 +12,8 @@ namespace Content.Server.GameObjects.Components.Items
{
internal static class ThrowHelper
{
private const float ThrowAngularImpulse = 3.0f;
/// <summary>
/// Tries to throw the entity if it has a physics component, otherwise does nothing.
/// </summary>
@@ -41,6 +43,8 @@ namespace Content.Server.GameObjects.Components.Items
if (entity.HasComponent<ItemComponent>())
{
entity.EnsureComponent<ThrownItemComponent>().Thrower = user;
// Give it a l'il spin.
physicsComponent.ApplyAngularImpulse(ThrowAngularImpulse);
if (user != null)
EntitySystem.Get<InteractionSystem>().ThrownInteraction(user, entity);