]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Doors will no longer be pried open once the doafter finishes if they shouldn't. ...
authornikthechampiongr <32041239+nikthechampiongr@users.noreply.github.com>
Tue, 9 Jan 2024 22:05:02 +0000 (00:05 +0200)
committerGitHub <noreply@github.com>
Tue, 9 Jan 2024 22:05:02 +0000 (17:05 -0500)
* Fix bug where prying would succeed even a door could no longer be pried.

* Remove redundant call to Resolve

* Remove redundant comment

Content.Shared/Prying/Systems/PryingSystem.cs

index bc37ab035af2c851ededb7e4353e56799ed18681..36e42723df00bd1a2e9cf08a515b97a99020da11 100644 (file)
@@ -158,10 +158,19 @@ public sealed class PryingSystem : EntitySystem
         if (args.Target is null)
             return;
 
-        PryingComponent? comp = null;
+        TryComp<PryingComponent>(args.Used, out var comp);
+
+        if (!CanPry(uid, args.User, out var message, comp))
+        {
+            if (message != null)
+                Popup.PopupEntity(Loc.GetString(message), uid, args.User);
+            return;
+        }
 
-        if (args.Used != null && Resolve(args.Used.Value, ref comp))
-            _audioSystem.PlayPredicted(comp.UseSound, args.Used.Value, args.User);
+        // TODO: When we get airlock prediction make this predicted.
+        // When that happens also fix the checking function in the Client AirlockSystem.
+        if (args.Used != null && comp != null)
+            _audioSystem.PlayPvs(comp.UseSound, args.Used.Value);
 
         var ev = new PriedEvent(args.User);
         RaiseLocalEvent(uid, ref ev);