]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Allow unbuckling incapacitated people from vehicles. Fix being able to unbuckle yours...
authorVasilis <vasilis@pikachu.systems>
Thu, 16 Nov 2023 02:39:04 +0000 (03:39 +0100)
committerGitHub <noreply@github.com>
Thu, 16 Nov 2023 02:39:04 +0000 (21:39 -0500)
* a

* review

* reviews????

* another fix!

* goofy

* Fix my own fuckup

Content.Shared/Buckle/SharedBuckleSystem.Buckle.cs

index 6add0661339df0c29e8340a04ea46ea33fe10c47..9795a6f3dcd781f0bc488e39b1cf6899b60a4509 100644 (file)
@@ -435,9 +435,12 @@ public abstract partial class SharedBuckleSystem
             if (HasComp<SleepingComponent>(buckleUid) && buckleUid == userUid)
                 return false;
 
-            // If the strap is a vehicle and the rider is not the person unbuckling, return.
-            if (TryComp<VehicleComponent>(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<VehicleComponent>(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;
         }