From af29034218575e0e98ef72cae6cda49557d60590 Mon Sep 17 00:00:00 2001 From: 20kdc Date: Sat, 13 Nov 2021 21:43:37 +0000 Subject: [PATCH] No pulling yourself via your chair (#5324) --- .../Pulling/Systems/SharedPullingSystem.Actions.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs b/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs index 93393e9e49..cffcc4c633 100644 --- a/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs +++ b/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; using Content.Shared.Alert; +using Content.Shared.Buckle.Components; using Content.Shared.GameTicking; using Content.Shared.Input; using Content.Shared.Physics.Pull; @@ -49,6 +50,15 @@ namespace Content.Shared.Pulling return false; } + if (puller.TryGetComponent(out var buckle)) + { + // Prevent people pulling the chair they're on, etc. + if (buckle.Buckled && (buckle.LastEntityBuckledTo == pulled.Uid)) + { + return false; + } + } + var startPull = new StartPullAttemptEvent(puller, pulled); RaiseLocalEvent(puller.Uid, startPull); return !startPull.Cancelled;