]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
fix grappling hooks getting bricked (#32738)
authordeltanedas <39013340+deltanedas@users.noreply.github.com>
Wed, 16 Oct 2024 22:32:32 +0000 (22:32 +0000)
committerGitHub <noreply@github.com>
Wed, 16 Oct 2024 22:32:32 +0000 (09:32 +1100)
Co-authored-by: deltanedas <@deltanedas:kde.org>
Content.Shared/Weapons/Misc/SharedGrapplingGunSystem.cs

index d2f0333b8332d61809154600df871d0de3e9aaea..e790973538ffb6915ed33aeb886d632563edb498 100644 (file)
@@ -114,19 +114,14 @@ public abstract class SharedGrapplingGunSystem : EntitySystem
 
     private void OnGunActivate(EntityUid uid, GrapplingGunComponent component, ActivateInWorldEvent args)
     {
-        if (!Timing.IsFirstTimePredicted || args.Handled || !args.Complex)
-            return;
-
-        if (Deleted(component.Projectile))
+        if (!Timing.IsFirstTimePredicted || args.Handled || !args.Complex || component.Projectile is not {} projectile)
             return;
 
         _audio.PlayPredicted(component.CycleSound, uid, args.User);
         _appearance.SetData(uid, SharedTetherGunSystem.TetherVisualsStatus.Key, true);
 
         if (_netManager.IsServer)
-        {
-            QueueDel(component.Projectile.Value);
-        }
+            QueueDel(projectile);
 
         component.Projectile = null;
         SetReeling(uid, component, false, args.User);