Don't spin thrown pies (#4328)

This commit is contained in:
metalgearsloth
2021-07-23 16:12:07 +10:00
committed by GitHub
parent 4503a6f0ee
commit 30c28dafb9
3 changed files with 16 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
using System;
using Content.Server.Interaction;
using Content.Server.Items;
using Content.Shared.MobState;
using Content.Shared.Tag;
using Content.Shared.Throwing;
using Robust.Shared.GameObjects;
using Robust.Shared.Log;
@@ -43,7 +45,14 @@ namespace Content.Server.Throwing
{
entity.EnsureComponent<ThrownItemComponent>().Thrower = user;
// Give it a l'il spin.
physicsComponent.ApplyAngularImpulse(ThrowAngularImpulse);
if (!entity.HasTag("NoSpinOnThrow"))
{
physicsComponent.ApplyAngularImpulse(ThrowAngularImpulse);
}
else
{
entity.Transform.LocalRotation = direction.ToWorldAngle() - Math.PI;
}
if (user != null)
EntitySystem.Get<InteractionSystem>().ThrownInteraction(user, entity);