From: Vasilis Date: Thu, 16 Nov 2023 02:39:04 +0000 (+0100) Subject: Allow unbuckling incapacitated people from vehicles. Fix being able to unbuckle yours... X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=e804860da54458d795362dbf78abec79a8d7644a;p=space-station-14.git 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 --- 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; }