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.Interaction;
using Content.Server.Items; using Content.Server.Items;
using Content.Shared.MobState; using Content.Shared.MobState;
using Content.Shared.Tag;
using Content.Shared.Throwing; using Content.Shared.Throwing;
using Robust.Shared.GameObjects; using Robust.Shared.GameObjects;
using Robust.Shared.Log; using Robust.Shared.Log;
@@ -43,7 +45,14 @@ namespace Content.Server.Throwing
{ {
entity.EnsureComponent<ThrownItemComponent>().Thrower = user; entity.EnsureComponent<ThrownItemComponent>().Thrower = user;
// Give it a l'il spin. // 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) if (user != null)
EntitySystem.Get<InteractionSystem>().ThrownInteraction(user, entity); EntitySystem.Get<InteractionSystem>().ThrownInteraction(user, entity);

View File

@@ -18,6 +18,9 @@
Quantity: 15 Quantity: 15
- type: SliceableFood - type: SliceableFood
count: 4 count: 4
- type: Tag
tags:
- NoSpinOnThrow
- type: entity - type: entity
parent: FoodPieBase parent: FoodPieBase

View File

@@ -34,6 +34,9 @@
- type: Tag - type: Tag
id: Ingot id: Ingot
- type: Tag
id: NoSpinOnThrow
- type: Tag - type: Tag
id: Ore id: Ore