]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Stop toys from electrocuting on attack (#15318)
authorDawid Bla <46636558+DawBla@users.noreply.github.com>
Wed, 12 Apr 2023 00:11:55 +0000 (02:11 +0200)
committerGitHub <noreply@github.com>
Wed, 12 Apr 2023 00:11:55 +0000 (17:11 -0700)
Content.Server/Electrocution/ElectrocutionSystem.cs

index 00f947f6a38343735809e294b3b9f8748c7eb7e1..811232a86a166e1e05d4dfe99086638863506855 100644 (file)
@@ -130,6 +130,13 @@ namespace Content.Server.Electrocution
             if (!electrified.OnAttacked)
                 return;
 
+            //Dont shock if the attacker used a toy
+            if (EntityManager.TryGetComponent<MeleeWeaponComponent>(args.Used, out var meleeWeaponComponent))
+            {
+                if (meleeWeaponComponent.Damage.Total == 0)
+                    return;
+            }
+
             TryDoElectrifiedAct(uid, args.User, 1, electrified);
         }