Vehicle stun/sleep immunity fix (#18962)

* Fix stuns on vehicles

* Unicycle 1984

* Fix sleeping and driving

* Discard that too
This commit is contained in:
Doru991
2023-08-13 10:13:19 +03:00
committed by GitHub
parent ef740601f0
commit a554ad24e1
3 changed files with 12 additions and 1 deletions

View File

@@ -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();
}