No pulling yourself via your chair (#5324)

This commit is contained in:
20kdc
2021-11-13 21:43:37 +00:00
committed by GitHub
parent 7d8b57f7a4
commit af29034218

View File

@@ -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<SharedBuckleComponent>(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;