From c6de63c53532f564e05723cf1deef90bd5ee2c26 Mon Sep 17 00:00:00 2001 From: Dawid Bla <46636558+DawBla@users.noreply.github.com> Date: Wed, 12 Apr 2023 02:11:55 +0200 Subject: [PATCH] Stop toys from electrocuting on attack (#15318) --- Content.Server/Electrocution/ElectrocutionSystem.cs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Content.Server/Electrocution/ElectrocutionSystem.cs b/Content.Server/Electrocution/ElectrocutionSystem.cs index 00f947f6a3..811232a86a 100644 --- a/Content.Server/Electrocution/ElectrocutionSystem.cs +++ b/Content.Server/Electrocution/ElectrocutionSystem.cs @@ -130,6 +130,13 @@ namespace Content.Server.Electrocution if (!electrified.OnAttacked) return; + //Dont shock if the attacker used a toy + if (EntityManager.TryGetComponent(args.Used, out var meleeWeaponComponent)) + { + if (meleeWeaponComponent.Damage.Total == 0) + return; + } + TryDoElectrifiedAct(uid, args.User, 1, electrified); }