Pulling change entity rotation (#3890)

* Moved rotatable to shared

* Pullable change rotation

* Applied review

* Update Content.Shared/GameObjects/EntitySystems/SharedPullingSystem.cs

Co-authored-by: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
This commit is contained in:
Alex Evgrashin
2021-05-05 06:29:26 +03:00
committed by GitHub
parent ad3b7fe97d
commit 9857f8197c
5 changed files with 84 additions and 14 deletions

View File

@@ -1,27 +1,19 @@
using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
#nullable enable
using Content.Shared.GameObjects.Components.Rotatable;
using Content.Shared.GameObjects.EntitySystems.ActionBlocker;
using Content.Shared.GameObjects.Verbs;
using Content.Shared.Interfaces;
using Robust.Shared.GameObjects;
using Robust.Shared.Localization;
using Robust.Shared.Maths;
using Robust.Shared.Physics;
using Robust.Shared.Serialization.Manager.Attributes;
using Robust.Shared.ViewVariables;
namespace Content.Server.GameObjects.Components.Rotatable
{
[RegisterComponent]
public class RotatableComponent : Component
[ComponentReference(typeof(SharedRotatableComponent))]
public class RotatableComponent : SharedRotatableComponent
{
public override string Name => "Rotatable";
/// <summary>
/// If true, this entity can be rotated even while anchored.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[DataField("rotateWhileAnchored")]
public bool RotateWhileAnchored { get; private set; }
private void TryRotate(IEntity user, Angle angle)
{
if (!RotateWhileAnchored && Owner.TryGetComponent(out IPhysBody? physics))