Vehicle stun/sleep immunity fix (#18962)
* Fix stuns on vehicles * Unicycle 1984 * Fix sleeping and driving * Discard that too
This commit is contained in:
@@ -131,6 +131,16 @@ public abstract partial class SharedBuckleSystem
|
||||
|
||||
private void OnBuckleStandAttempt(EntityUid uid, BuckleComponent component, StandAttemptEvent args)
|
||||
{
|
||||
//Let entities stand back up while on vehicles so that they can be knocked down when slept/stunned
|
||||
//This prevents an exploit that allowed people to become partially invulnerable to stuns
|
||||
//while on vehicles
|
||||
|
||||
if (component.BuckledTo != null)
|
||||
{
|
||||
var buckle = component.BuckledTo;
|
||||
if (TryComp<VehicleComponent>(buckle, out _))
|
||||
return;
|
||||
}
|
||||
if (component.Buckled)
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@ using System.Numerics;
|
||||
using Content.Shared.Mobs.Systems;
|
||||
using Robust.Shared.Physics.Components;
|
||||
using Robust.Shared.Physics.Systems;
|
||||
using Content.Shared.Bed.Sleep;
|
||||
|
||||
namespace Content.Shared.Movement.Systems
|
||||
{
|
||||
@@ -123,6 +124,7 @@ namespace Content.Shared.Movement.Systems
|
||||
if (RelayTargetQuery.TryGetComponent(uid, out var relayTarget))
|
||||
{
|
||||
if (_mobState.IsIncapacitated(relayTarget.Source) ||
|
||||
TryComp<SleepingComponent>(relayTarget.Source, out _) ||
|
||||
!MoverQuery.TryGetComponent(relayTarget.Source, out var relayedMover))
|
||||
{
|
||||
canMove = false;
|
||||
|
||||
@@ -374,7 +374,6 @@
|
||||
description: It only has one wheel!
|
||||
components:
|
||||
- type: Vehicle
|
||||
useHand: false
|
||||
northOver: true
|
||||
southOver: true
|
||||
northOverride: -0.15
|
||||
|
||||
Reference in New Issue
Block a user