]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
moved a bit of IonStorm code elsewhere
authorThe Canned One <greentopcan@gmail.com>
Tue, 1 Oct 2024 08:42:52 +0000 (10:42 +0200)
committerThe Canned One <greentopcan@gmail.com>
Tue, 1 Oct 2024 08:42:52 +0000 (10:42 +0200)
Content.Server/Silicons/Laws/IonStormSystem.cs
Content.Server/Silicons/Laws/StartIonStormedSystem.cs
Content.Server/StationEvents/Events/IonStormRule.cs

index 87df0d8cf2c259a4dd3094db5f23c4e8b4b99bc7..cf31a9e19f71a79dee1cae0d08da687e3966823d 100644 (file)
@@ -9,7 +9,6 @@ using Content.Shared.Random;
 using Content.Shared.Random.Helpers;
 using Content.Shared.Silicons.Laws;
 using Content.Shared.Silicons.Laws.Components;
-using Content.Shared.Station.Components;
 using Robust.Shared.Prototypes;
 using Robust.Shared.Random;
 
@@ -60,12 +59,8 @@ public sealed class IonStormSystem : EntitySystem
     [ValidatePrototypeId<DatasetPrototype>]
     private const string Foods = "IonStormFoods";
 
-    public void IonStormTarget(EntityUid ent, SiliconLawBoundComponent lawBound, TransformComponent xform, IonStormTargetComponent target, EntityUid? chosenStation, bool ignoreStation = false, bool adminlog = true)
+    public void IonStormTarget(EntityUid ent, SiliconLawBoundComponent lawBound, TransformComponent xform, IonStormTargetComponent target, EntityUid? chosenStation, bool adminlog = true)
     {
-        // only affect law holders on the station unless ignoreStation is true.
-        if (CompOrNull<StationMemberComponent>(xform.GridUid)?.Station != chosenStation && !ignoreStation)
-            return;
-
         if (!_robustRandom.Prob(target.Chance))
             return;
 
index f7b65e1a041f1fc052974f4e90e7b68a96e14547..887bc051ddeddef033df6fb3b88bbed050091de4 100644 (file)
@@ -31,7 +31,7 @@ public sealed class StartIonStormedSystem : EntitySystem
 
         for (int currentIonStorm = 0; currentIonStorm < component.IonStormAmount; currentIonStorm++)
         {
-            _ionStorm.IonStormTarget(uid, lawBound, xform, target, null, true, false);
+            _ionStorm.IonStormTarget(uid, lawBound, xform, target, null, false);
         }
 
         var laws = _siliconLaw.GetLaws(uid, lawBound);
index 6d1834c576665f6e615373d9c98920c11a94f145..05d079fb3d9376672a34ea5a3ce21c3dad489905 100644 (file)
@@ -4,6 +4,7 @@ using Content.Server.StationEvents.Components;
 using Content.Shared.GameTicking.Components;
 using Content.Shared.Silicons.Laws;
 using Content.Shared.Silicons.Laws.Components;
+using Content.Shared.Station.Components;
 
 namespace Content.Server.StationEvents.Events;
 
@@ -21,6 +22,10 @@ public sealed class IonStormRule : StationEventSystem<IonStormRuleComponent>
         var query = EntityQueryEnumerator<SiliconLawBoundComponent, TransformComponent, IonStormTargetComponent>();
         while (query.MoveNext(out var ent, out var lawBound, out var xform, out var target))
         {
+            // only affect law holders on the station
+            if (CompOrNull<StationMemberComponent>(xform.GridUid)?.Station != chosenStation)
+                continue;
+
             _ionStorm.IonStormTarget(ent, lawBound, xform, target, chosenStation);
         }
     }