Add minimum distance for pilot breaking (#5232)

This commit is contained in:
metalgearsloth
2021-11-11 18:42:34 +11:00
committed by GitHub
parent 7f4b47d1e6
commit 6271eb440b
2 changed files with 26 additions and 3 deletions

View File

@@ -2,6 +2,7 @@ using System;
using Robust.Shared.GameObjects;
using Robust.Shared.GameStates;
using Robust.Shared.Log;
using Robust.Shared.Map;
using Robust.Shared.Players;
using Robust.Shared.Serialization;
using Robust.Shared.ViewVariables;
@@ -12,12 +13,19 @@ namespace Content.Shared.Shuttles
/// Stores what shuttle this entity is currently piloting.
/// </summary>
[RegisterComponent]
[NetworkedComponent()]
[NetworkedComponent]
public sealed class PilotComponent : Component
{
public override string Name => "Pilot";
[ViewVariables] public SharedShuttleConsoleComponent? Console { get; set; }
/// <summary>
/// Where we started piloting from to check if we should break from moving too far.
/// </summary>
[ViewVariables] public EntityCoordinates? Position { get; set; }
public const float BreakDistance = 0.25f;
public override void HandleComponentState(ComponentState? curState, ComponentState? nextState)
{
base.HandleComponentState(curState, nextState);