minor thruster system cleanup (#35143)

This commit is contained in:
slarticodefast
2025-02-14 00:44:27 +01:00
committed by GitHub
parent b07633de1c
commit 3b142890cd

View 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);