Do not allow starting pulling while cuffed (#5457)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
|
using Content.Shared.ActionBlocker;
|
||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
using Content.Shared.Buckle.Components;
|
using Content.Shared.Buckle.Components;
|
||||||
using Content.Shared.GameTicking;
|
using Content.Shared.GameTicking;
|
||||||
@@ -14,6 +15,7 @@ using Robust.Shared.Containers;
|
|||||||
using Robust.Shared.GameObjects;
|
using Robust.Shared.GameObjects;
|
||||||
using Robust.Shared.Input.Binding;
|
using Robust.Shared.Input.Binding;
|
||||||
using Robust.Shared.Map;
|
using Robust.Shared.Map;
|
||||||
|
using Robust.Shared.IoC;
|
||||||
using Robust.Shared.Maths;
|
using Robust.Shared.Maths;
|
||||||
using Robust.Shared.Physics;
|
using Robust.Shared.Physics;
|
||||||
using Robust.Shared.Players;
|
using Robust.Shared.Players;
|
||||||
@@ -23,6 +25,8 @@ namespace Content.Shared.Pulling
|
|||||||
{
|
{
|
||||||
public abstract partial class SharedPullingSystem : EntitySystem
|
public abstract partial class SharedPullingSystem : EntitySystem
|
||||||
{
|
{
|
||||||
|
[Dependency] private readonly ActionBlockerSystem _blocker = default!;
|
||||||
|
|
||||||
public bool CanPull(IEntity puller, IEntity pulled)
|
public bool CanPull(IEntity puller, IEntity pulled)
|
||||||
{
|
{
|
||||||
if (!puller.HasComponent<SharedPullerComponent>())
|
if (!puller.HasComponent<SharedPullerComponent>())
|
||||||
@@ -30,6 +34,11 @@ namespace Content.Shared.Pulling
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!_blocker.CanInteract(puller.Uid))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
if (!pulled.TryGetComponent<IPhysBody>(out var _physics))
|
if (!pulled.TryGetComponent<IPhysBody>(out var _physics))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
Reference in New Issue
Block a user