]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix spreader test (#15303)
authormetalgearsloth <31366439+metalgearsloth@users.noreply.github.com>
Tue, 11 Apr 2023 10:02:24 +0000 (20:02 +1000)
committerGitHub <noreply@github.com>
Tue, 11 Apr 2023 10:02:24 +0000 (03:02 -0700)
Content.Server/Spreader/SpreaderSystem.cs
Resources/Maps/bagel.yml

index d8b87eb670d4c2cd61630ca7fc7dfe02d332dd2e..a9d4d496280d9c4e49effbe8485839129f01dc06 100644 (file)
@@ -32,12 +32,19 @@ public sealed class SpreaderSystem : EntitySystem
     {
         SubscribeLocalEvent<AirtightChanged>(OnAirtightChanged);
         SubscribeLocalEvent<GridInitializeEvent>(OnGridInit);
+        SubscribeLocalEvent<SpreaderGridComponent, MapInitEvent>(OnSpreaderGridMapInit);
+
         SubscribeLocalEvent<SpreaderGridComponent, EntityUnpausedEvent>(OnGridUnpaused);
 
         SetupPrototypes();
         _prototype.PrototypesReloaded += OnPrototypeReload;
     }
 
+    private void OnSpreaderGridMapInit(EntityUid uid, SpreaderGridComponent component, MapInitEvent args)
+    {
+        component.NextUpdate = _timing.CurTime;
+    }
+
     public override void Shutdown()
     {
         base.Shutdown();
@@ -80,12 +87,7 @@ public sealed class SpreaderSystem : EntitySystem
     private void OnGridInit(GridInitializeEvent ev)
     {
         var comp = EnsureComp<SpreaderGridComponent>(ev.EntityUid);
-        var nextUpdate = _timing.CurTime;
 
-        // TODO: I believe we need grid mapinit events so we can set the time correctly only on mapinit
-        // and not touch it on regular init.
-        if (comp.NextUpdate < nextUpdate)
-            comp.NextUpdate = nextUpdate;
     }
 
     /// <inheritdoc/>
index ee55f06cca02ae1588a9ed23639d701d91ff8a2a..2cefa15e96994adb27ddaa44622d8ab4650afcb2 100644 (file)
@@ -9111,12 +9111,12 @@ entities:
     type: GridAtmosphere\r
   - type: OccluderTree\r
   - type: Shuttle\r
-  - nextUpdate: 8187.135845\r
+  - nextUpdate: 0.45\r
     type: GridPathfinding\r
+  - nextUpdate: 1\r
+    type: SpreaderGrid\r
   - type: RadiationGridResistance\r
   - type: GasTileOverlay\r
-  - nextUpdate: 0\r
-    type: SpreaderGrid\r
 - uid: 61\r
   type: GasVentScrubber\r
   components:\r
@@ -67312,8 +67312,10 @@ entities:
     type: Fixtures\r
   - type: OccluderTree\r
   - type: Shuttle\r
-  - nextUpdate: 1984.9758152\r
+  - nextUpdate: 0.45\r
     type: GridPathfinding\r
+  - nextUpdate: 1\r
+    type: SpreaderGrid\r
   - gravityShakeSound: !type:SoundPathSpecifier\r
       path: /Audio/Effects/alert.ogg\r
     type: Gravity\r
@@ -67526,8 +67528,6 @@ entities:
     type: GridAtmosphere\r
   - type: GasTileOverlay\r
   - type: RadiationGridResistance\r
-  - nextUpdate: 0\r
-    type: SpreaderGrid\r
 - uid: 7537\r
   type: ClothingNeckScarfStripedBlue\r
   components:\r
@@ -97141,7 +97141,7 @@ entities:
     type: Transform\r
   - charge: 100\r
     type: GravityGenerator\r
-  - radius: 175.75\r
+  - radius: 4\r
     type: PointLight\r
 - uid: 11695\r
   type: VendingMachineSciDrobe\r