Fix pulling mispredicts (#22941)
* Fix pulling mispredicts * Make behaviour consistent * Good ol terminating entities
This commit is contained in:
@@ -12,6 +12,8 @@ using Robust.Shared.Map;
|
||||
using Robust.Shared.Physics;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Robust.Shared.Timing;
|
||||
using Robust.Shared.Utility;
|
||||
|
||||
namespace Content.Shared.Pulling
|
||||
{
|
||||
@@ -23,6 +25,7 @@ namespace Content.Shared.Pulling
|
||||
[Dependency] private readonly SharedInteractionSystem _interaction = default!;
|
||||
[Dependency] private readonly SharedPhysicsSystem _physics = default!;
|
||||
[Dependency] private readonly ISharedAdminLogManager _adminLogger = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
|
||||
public bool CanPull(EntityUid puller, EntityUid pulled)
|
||||
{
|
||||
@@ -90,6 +93,9 @@ namespace Content.Shared.Pulling
|
||||
|
||||
public bool TryStopPull(SharedPullableComponent pullable, EntityUid? user = null)
|
||||
{
|
||||
if (_timing.ApplyingState)
|
||||
return false;
|
||||
|
||||
if (!pullable.BeingPulled)
|
||||
{
|
||||
return false;
|
||||
@@ -127,6 +133,9 @@ namespace Content.Shared.Pulling
|
||||
// The main "start pulling" function.
|
||||
public bool TryStartPull(SharedPullerComponent puller, SharedPullableComponent pullable)
|
||||
{
|
||||
if (_timing.ApplyingState)
|
||||
return false;
|
||||
|
||||
if (puller.Pulling == pullable.Owner)
|
||||
return true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user