]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix mobs not being able to pry doors by just left clicking on them (#27349)
authorDrSmugleaf <10968691+DrSmugleaf@users.noreply.github.com>
Fri, 26 Apr 2024 12:17:25 +0000 (05:17 -0700)
committerGitHub <noreply@github.com>
Fri, 26 Apr 2024 12:17:25 +0000 (14:17 +0200)
Content.Shared/Prying/Systems/PryingSystem.cs

index 69a63f72b54a416ac51afc7f987701e11881676f..5a15057f1e394140e15e7d761a223907234aa397 100644 (file)
@@ -1,15 +1,14 @@
-using Content.Shared.Prying.Components;
-using Content.Shared.Verbs;
-using Content.Shared.DoAfter;
-using Robust.Shared.Serialization;
+using System.Diagnostics.CodeAnalysis;
 using Content.Shared.Administration.Logs;
 using Content.Shared.Database;
+using Content.Shared.DoAfter;
 using Content.Shared.Doors.Components;
-using System.Diagnostics.CodeAnalysis;
 using Content.Shared.Interaction;
 using Content.Shared.Popups;
-using Robust.Shared.Audio;
+using Content.Shared.Prying.Components;
+using Content.Shared.Verbs;
 using Robust.Shared.Audio.Systems;
+using Robust.Shared.Serialization;
 using PryUnpoweredComponent = Content.Shared.Prying.Components.PryUnpoweredComponent;
 
 namespace Content.Shared.Prying.Systems;
@@ -99,14 +98,16 @@ public sealed class PryingSystem : EntitySystem
             // to be marked as handled.
             return true;
 
-        return StartPry(target, user, null, 0.1f, out id); // hand-prying is much slower
+        // hand-prying is much slower
+        var modifier = CompOrNull<PryingComponent>(user)?.SpeedModifier ?? 0.1f;
+        return StartPry(target, user, null, modifier, out id);
     }
 
     private bool CanPry(EntityUid target, EntityUid user, out string? message, PryingComponent? comp = null)
     {
         BeforePryEvent canev;
 
-        if (comp != null)
+        if (comp != null || Resolve(user, ref comp))
         {
             canev = new BeforePryEvent(user, comp.PryPowered, comp.Force);
         }