]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
minor thruster system cleanup (#35143)
authorslarticodefast <161409025+slarticodefast@users.noreply.github.com>
Thu, 13 Feb 2025 23:44:27 +0000 (00:44 +0100)
committerGitHub <noreply@github.com>
Thu, 13 Feb 2025 23:44:27 +0000 (00:44 +0100)
Content.Server/Shuttles/Systems/ThrusterSystem.cs

index a75ddc911a47ddecf19161dc8b52deaa07e8948b..74008a6af7f6da64793ebc11544013b3446d2ad4 100644 (file)
@@ -44,6 +44,7 @@ public sealed class ThrusterSystem : EntitySystem
         base.Initialize();
         SubscribeLocalEvent<ThrusterComponent, ActivateInWorldEvent>(OnActivateThruster);
         SubscribeLocalEvent<ThrusterComponent, ComponentInit>(OnThrusterInit);
+        SubscribeLocalEvent<ThrusterComponent, MapInitEvent>(OnMapInit);
         SubscribeLocalEvent<ThrusterComponent, ComponentShutdown>(OnThrusterShutdown);
         SubscribeLocalEvent<ThrusterComponent, PowerChangedEvent>(OnPowerChange);
         SubscribeLocalEvent<ThrusterComponent, AnchorStateChangedEvent>(OnAnchorChange);
@@ -232,8 +233,6 @@ public sealed class ThrusterSystem : EntitySystem
 
     private void OnThrusterInit(EntityUid uid, ThrusterComponent component, ComponentInit args)
     {
-        component.NextFire = _timing.CurTime + component.FireCooldown;
-
         _ambient.SetAmbience(uid, false);
 
         if (!component.Enabled)
@@ -247,6 +246,11 @@ public sealed class ThrusterSystem : EntitySystem
         }
     }
 
+    private void OnMapInit(Entity<ThrusterComponent> ent, ref MapInitEvent args)
+    {
+        ent.Comp.NextFire = _timing.CurTime + ent.Comp.FireCooldown;
+    }
+
     private void OnThrusterShutdown(EntityUid uid, ThrusterComponent component, ComponentShutdown args)
     {
         DisableThruster(uid, component);