From 4e7bdc66582fa0a4418a7c4759d9b2f7062f6805 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Tue, 24 Oct 2023 17:22:05 +1100 Subject: [PATCH] Fix electrocution resolve error log (#21179) --- Content.Server/Electrocution/ElectrocutionSystem.cs | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/Content.Server/Electrocution/ElectrocutionSystem.cs b/Content.Server/Electrocution/ElectrocutionSystem.cs index 6c96266740..8ddc8540c0 100644 --- a/Content.Server/Electrocution/ElectrocutionSystem.cs +++ b/Content.Server/Electrocution/ElectrocutionSystem.cs @@ -192,18 +192,13 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem private void OnLightAttacked(EntityUid uid, PoweredLightComponent component, AttackedEvent args) { - - if (!_meleeWeapon.GetDamage(args.Used, args.User).Any()) - return; - - if (args.Used != args.User) + if (!component.CurrentLit || args.Used != args.User) return; - if (component.CurrentLit == false) + if (!_meleeWeapon.GetDamage(args.Used, args.User).Any()) return; DoCommonElectrocution(args.User, uid, component.UnarmedHitShock, component.UnarmedHitStun, false, 1); - } private void OnElectrifiedInteractUsing(EntityUid uid, ElectrifiedComponent electrified, InteractUsingEvent args) @@ -498,7 +493,7 @@ public sealed class ElectrocutionSystem : SharedElectrocutionSystem private void PlayElectrocutionSound(EntityUid targetUid, EntityUid sourceUid, ElectrifiedComponent? electrified = null) { - if (!Resolve(sourceUid, ref electrified) || !electrified.PlaySoundOnShock) + if (!Resolve(sourceUid, ref electrified, false) || !electrified.PlaySoundOnShock) { return; } -- 2.51.2