]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix Ninja EMP themselves. (#40968)
authorPrincess Cheeseballs <66055347+Princess-Cheeseballs@users.noreply.github.com>
Sat, 18 Oct 2025 23:56:32 +0000 (16:56 -0700)
committerGitHub <noreply@github.com>
Sat, 18 Oct 2025 23:56:32 +0000 (23:56 +0000)
* push

* Skibidi toiler

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
Content.Shared/Power/EntitySystems/SharedBatterySystem.cs
Content.Shared/PowerCell/SharedPowerCellSystem.cs

index 90931ef9f17f26d358b4fd5902d834f9e781150f..a9d5db3f331615de28d47f4665b753b15c15f3f0 100644 (file)
@@ -12,12 +12,12 @@ public abstract class SharedBatterySystem : EntitySystem
         SubscribeLocalEvent<BatteryComponent, EmpPulseEvent>(OnEmpPulse);
     }
 
-    private void OnEmpPulse(EntityUid uid, BatteryComponent component, ref EmpPulseEvent args)
+    private void OnEmpPulse(Entity<BatteryComponent> 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)
index 0b71a3c24df64780b655af82702037e0c8993e7d..a32687c15c1f1613614d69451ab444c6f9c52974 100644 (file)
@@ -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<PowerCellComponent> 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<PowerCellSlotComponent>(parent))
             RaiseLocalEvent(parent, ref args);