This commit is contained in:
rhailrake
2023-09-08 18:29:57 +06:00
committed by Aviu00
parent 56980a73da
commit b52c223a5d
2 changed files with 12 additions and 0 deletions

View File

@@ -12,6 +12,11 @@ using Content.Shared.Inventory;
using Content.Shared.Verbs;
using Robust.Shared.Containers;
using Robust.Shared.Prototypes;
using Content.Shared.Verbs;
using Content.Server.Popups;
using Content.Shared.ActionBlocker;
using Content.Shared.DoAfter;
using Content.Shared.Internals;
using Robust.Shared.Utility;
namespace Content.Server.Body.Systems;
@@ -26,6 +31,7 @@ public sealed class InternalsSystem : EntitySystem
[Dependency] private readonly HandsSystem _hands = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly ActionBlockerSystem _actionBlocker = default!;
public const SlotFlags InventorySlots = SlotFlags.POCKET | SlotFlags.BELT;
@@ -64,6 +70,9 @@ public sealed class InternalsSystem : EntitySystem
if (!Resolve(uid, ref internals, false))
return;
if (_actionBlocker.CanInteract(user, uid) == false)
return;
// Toggle off if they're on
if (AreInternalsWorking(internals))
{

View File

@@ -437,6 +437,9 @@ public abstract partial class SharedBuckleSystem
if (HasComp<SleepingComponent>(buckleUid) && buckleUid == userUid)
return false;
if (ActionBlocker.CanInteract(userUid, buckleUid) == false)
return false;
// If the strap is a vehicle and the rider is not the person unbuckling, return. Unless the rider is crit or dead.
if (TryComp<VehicleComponent>(strapUid, out var vehicle) && vehicle.Rider != userUid && !_mobState.IsIncapacitated(buckleUid))
return false;