From: Princess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com> Date: Sat, 18 Oct 2025 23:56:32 +0000 (-0700) Subject: Fix Ninja EMP themselves. (#40968) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=24216b1bc877312a4f034da7307aaccbbd627468;p=space-station-14.git Fix Ninja EMP themselves. (#40968) * push * Skibidi toiler --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com> --- diff --git a/Content.Shared/Power/EntitySystems/SharedBatterySystem.cs b/Content.Shared/Power/EntitySystems/SharedBatterySystem.cs index 90931ef9f1..a9d5db3f33 100644 --- a/Content.Shared/Power/EntitySystems/SharedBatterySystem.cs +++ b/Content.Shared/Power/EntitySystems/SharedBatterySystem.cs @@ -12,12 +12,12 @@ public abstract class SharedBatterySystem : EntitySystem SubscribeLocalEvent(OnEmpPulse); } - private void OnEmpPulse(EntityUid uid, BatteryComponent component, ref EmpPulseEvent args) + private void OnEmpPulse(Entity entity, ref EmpPulseEvent args) { args.Affected = true; - UseCharge(uid, args.EnergyConsumption, component); + UseCharge(entity, args.EnergyConsumption, entity.Comp); // Apply a cooldown to the entity's self recharge if needed to avoid it immediately self recharging after an EMP. - TrySetChargeCooldown(uid); + TrySetChargeCooldown(entity); } public virtual float UseCharge(EntityUid uid, float value, BatteryComponent? battery = null) diff --git a/Content.Shared/PowerCell/SharedPowerCellSystem.cs b/Content.Shared/PowerCell/SharedPowerCellSystem.cs index 0b71a3c24d..a32687c15c 100644 --- a/Content.Shared/PowerCell/SharedPowerCellSystem.cs +++ b/Content.Shared/PowerCell/SharedPowerCellSystem.cs @@ -74,9 +74,9 @@ public abstract class SharedPowerCellSystem : EntitySystem RaiseLocalEvent(uid, new PowerCellChangedEvent(true), false); } - private void OnCellEmpAttempt(EntityUid uid, PowerCellComponent component, EmpAttemptEvent args) + private void OnCellEmpAttempt(Entity entity, ref EmpAttemptEvent args) { - var parent = Transform(uid).ParentUid; + var parent = Transform(entity).ParentUid; // relay the attempt event to the slot so it can cancel it if (HasComp(parent)) RaiseLocalEvent(parent, ref args);