From 30c28dafb9f818a4fe25f5dabfd086aa180fce05 Mon Sep 17 00:00:00 2001 From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Fri, 23 Jul 2021 16:12:07 +1000 Subject: [PATCH] Don't spin thrown pies (#4328) --- Content.Server/Throwing/ThrowHelper.cs | 11 ++++++++++- .../Entities/Objects/Consumable/Food/Baked/pie.yml | 3 +++ Resources/Prototypes/tags.yml | 3 +++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Content.Server/Throwing/ThrowHelper.cs b/Content.Server/Throwing/ThrowHelper.cs index 514c3a16ce..0dcbbbe81b 100644 --- a/Content.Server/Throwing/ThrowHelper.cs +++ b/Content.Server/Throwing/ThrowHelper.cs @@ -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().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().ThrownInteraction(user, entity); diff --git a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml index 230734b03b..b636863570 100644 --- a/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml +++ b/Resources/Prototypes/Entities/Objects/Consumable/Food/Baked/pie.yml @@ -18,6 +18,9 @@ Quantity: 15 - type: SliceableFood count: 4 + - type: Tag + tags: + - NoSpinOnThrow - type: entity parent: FoodPieBase diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index bf308e9261..0e914366ca 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -34,6 +34,9 @@ - type: Tag id: Ingot +- type: Tag + id: NoSpinOnThrow + - type: Tag id: Ore