From: metalgearsloth <31366439+metalgearsloth@users.noreply.github.com> Date: Tue, 11 Apr 2023 10:02:24 +0000 (+1000) Subject: Fix spreader test (#15303) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=793a09336e2cd59c91ef3acf87cc7e7a5d509fc4;p=space-station-14.git Fix spreader test (#15303) --- diff --git a/Content.Server/Spreader/SpreaderSystem.cs b/Content.Server/Spreader/SpreaderSystem.cs index d8b87eb670..a9d4d49628 100644 --- a/Content.Server/Spreader/SpreaderSystem.cs +++ b/Content.Server/Spreader/SpreaderSystem.cs @@ -32,12 +32,19 @@ public sealed class SpreaderSystem : EntitySystem { SubscribeLocalEvent(OnAirtightChanged); SubscribeLocalEvent(OnGridInit); + SubscribeLocalEvent(OnSpreaderGridMapInit); + SubscribeLocalEvent(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(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; } /// diff --git a/Resources/Maps/bagel.yml b/Resources/Maps/bagel.yml index ee55f06cca..2cefa15e96 100644 --- a/Resources/Maps/bagel.yml +++ b/Resources/Maps/bagel.yml @@ -9111,12 +9111,12 @@ entities: type: GridAtmosphere - type: OccluderTree - type: Shuttle - - nextUpdate: 8187.135845 + - nextUpdate: 0.45 type: GridPathfinding + - nextUpdate: 1 + type: SpreaderGrid - type: RadiationGridResistance - type: GasTileOverlay - - nextUpdate: 0 - type: SpreaderGrid - uid: 61 type: GasVentScrubber components: @@ -67312,8 +67312,10 @@ entities: type: Fixtures - type: OccluderTree - type: Shuttle - - nextUpdate: 1984.9758152 + - nextUpdate: 0.45 type: GridPathfinding + - nextUpdate: 1 + type: SpreaderGrid - gravityShakeSound: !type:SoundPathSpecifier path: /Audio/Effects/alert.ogg type: Gravity @@ -67526,8 +67528,6 @@ entities: type: GridAtmosphere - type: GasTileOverlay - type: RadiationGridResistance - - nextUpdate: 0 - type: SpreaderGrid - uid: 7537 type: ClothingNeckScarfStripedBlue components: @@ -97141,7 +97141,7 @@ entities: type: Transform - charge: 100 type: GravityGenerator - - radius: 175.75 + - radius: 4 type: PointLight - uid: 11695 type: VendingMachineSciDrobe