Fix pulling mispredicts (#22941)

* Fix pulling mispredicts

* Make behaviour consistent

* Good ol terminating entities
This commit is contained in:
Leon Friedrich
2023-12-25 02:33:32 -05:00
committed by GitHub
parent 9eaa4c3a5d
commit 721a445bbd
8 changed files with 42 additions and 77 deletions

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Serialization;
namespace Content.Shared.Pulling.Components
{
// Before you try to add another type than SharedPullingStateManagementSystem, consider the can of worms you may be opening!
[NetworkedComponent()]
[NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedPullingStateManagementSystem))]
[RegisterComponent]
public sealed partial class SharedPullableComponent : Component
@@ -13,11 +13,13 @@ namespace Content.Shared.Pulling.Components
/// <summary>
/// The current entity pulling this component.
/// </summary>
[DataField, AutoNetworkedField]
public EntityUid? Puller { get; set; }
/// <summary>
/// The pull joint.
/// </summary>
[DataField, AutoNetworkedField]
public string? PullJointId { get; set; }
public bool BeingPulled => Puller != null;
@@ -40,17 +42,6 @@ namespace Content.Shared.Pulling.Components
public bool PrevFixedRotation;
}
[Serializable, NetSerializable]
public sealed class PullableComponentState : ComponentState
{
public readonly NetEntity? Puller;
public PullableComponentState(NetEntity? puller)
{
Puller = puller;
}
}
/// <summary>
/// Raised when a request is made to stop pulling an entity.
/// </summary>