From e804860da54458d795362dbf78abec79a8d7644a Mon Sep 17 00:00:00 2001 From: Vasilis Date: Thu, 16 Nov 2023 03:39:04 +0100 Subject: [PATCH] Allow unbuckling incapacitated people from vehicles. Fix being able to unbuckle yourself while incapacitated (#21556) * a * review * reviews???? * another fix! * goofy * Fix my own fuckup --- Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs index 6add066133..9795a6f3dc 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs @@ -435,9 +435,12 @@ public abstract partial class SharedBuckleSystem if (HasComp(buckleUid) && buckleUid == userUid) return false; - // If the strap is a vehicle and the rider is not the person unbuckling, return. - if (TryComp(strapUid, out var vehicle) && - vehicle.Rider != userUid) + // If the strap is a vehicle and the rider is not the person unbuckling, return. Unless the rider is crit or dead. + if (TryComp(strapUid, out var vehicle) && vehicle.Rider != userUid && !_mobState.IsIncapacitated(buckleUid)) + return false; + + // If the person is crit or dead in any kind of strap, return. This prevents people from unbuckling themselves while incapacitated. + if (_mobState.IsIncapacitated(buckleUid) && userUid == buckleUid) return false; } -- 2.51.2