]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Ninja throwing star ability fix (#31684)
authorgodisdeadLOL <169250097+godisdeadLOL@users.noreply.github.com>
Tue, 3 Sep 2024 00:50:34 +0000 (03:50 +0300)
committerGitHub <noreply@github.com>
Tue, 3 Sep 2024 00:50:34 +0000 (18:50 -0600)
fixed ninja star not spawning

Co-authored-by: YourUsername <you@example.com>
Content.Server/Ninja/Systems/NinjaGlovesSystem.cs
Content.Server/Ninja/Systems/NinjaSuitSystem.cs

index 3aaf7c5d58e790bd4d7a4315257d6a86d2f53d43..ae7bb15fc43785c188836892672e1d7c9d7cee6d 100644 (file)
@@ -49,6 +49,7 @@ public sealed class NinjaGlovesSystem : SharedNinjaGlovesSystem
         {
             var ev = new NinjaBatteryChangedEvent(battery.Value, suit);
             RaiseLocalEvent(user, ref ev);
+            RaiseLocalEvent(suit, ref ev);
         }
     }
 }
index 63054eaad50ecc020c2de809c5b94640deb38931..244b7adf0362bb97a3cb331ef444092506cd71f2 100644 (file)
@@ -37,6 +37,16 @@ public sealed class NinjaSuitSystem : SharedNinjaSuitSystem
         base.NinjaEquipped(ent, user);
 
         _ninja.SetSuitPowerAlert(user);
+
+        // raise event to let ninja components get starting battery
+        _ninja.GetNinjaBattery(user.Owner, out var uid, out var _);
+
+        if (uid is not {} battery_uid)
+            return;
+
+        var ev = new NinjaBatteryChangedEvent(battery_uid, ent.Owner);
+        RaiseLocalEvent(ent, ref ev);
+        RaiseLocalEvent(user, ref ev);
     }
 
     // TODO: if/when battery is in shared, put this there too