No pulling yourself via your chair (#5324)
This commit is contained in:
@@ -2,6 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Diagnostics.CodeAnalysis;
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using Content.Shared.Alert;
|
using Content.Shared.Alert;
|
||||||
|
using Content.Shared.Buckle.Components;
|
||||||
using Content.Shared.GameTicking;
|
using Content.Shared.GameTicking;
|
||||||
using Content.Shared.Input;
|
using Content.Shared.Input;
|
||||||
using Content.Shared.Physics.Pull;
|
using Content.Shared.Physics.Pull;
|
||||||
@@ -49,6 +50,15 @@ namespace Content.Shared.Pulling
|
|||||||
return false;
|
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);
|
var startPull = new StartPullAttemptEvent(puller, pulled);
|
||||||
RaiseLocalEvent(puller.Uid, startPull);
|
RaiseLocalEvent(puller.Uid, startPull);
|
||||||
return !startPull.Cancelled;
|
return !startPull.Cancelled;
|
||||||
|
|||||||
Reference in New Issue
Block a user