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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user