Remove lights compref (#19531)

This commit is contained in:
metalgearsloth
2023-09-11 19:18:06 +10:00
committed by GitHub
parent d315ce3c8c
commit 99b77bc2d3
64 changed files with 222 additions and 132 deletions

View File

@@ -1,4 +1,3 @@
using System.Linq;
using System.Numerics;
using Content.Server.Audio;
using Content.Server.Construction;
@@ -12,9 +11,7 @@ using Content.Shared.Maps;
using Content.Shared.Physics;
using Content.Shared.Shuttles.Components;
using Content.Shared.Temperature;
using Robust.Server.GameObjects;
using Robust.Shared.Map;
using Robust.Shared.Map.Components;
using Robust.Shared.Physics.Collision.Shapes;
using Robust.Shared.Physics.Components;
using Robust.Shared.Physics.Events;
@@ -32,6 +29,7 @@ public sealed class ThrusterSystem : EntitySystem
[Dependency] private readonly AmbientSoundSystem _ambient = default!;
[Dependency] private readonly FixtureSystem _fixtureSystem = default!;
[Dependency] private readonly DamageableSystem _damageable = default!;
[Dependency] private readonly SharedPointLightSystem _light = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
// Essentially whenever thruster enables we update the shuttle's available impulses which are used for movement.
@@ -287,9 +285,9 @@ public sealed class ThrusterSystem : EntitySystem
_appearance.SetData(uid, ThrusterVisualState.State, true, appearance);
}
if (EntityManager.TryGetComponent(uid, out PointLightComponent? pointLightComponent))
if (_light.TryGetLight(uid, out var pointLightComponent))
{
pointLightComponent.Enabled = true;
_light.SetEnabled(uid, true, pointLightComponent);
}
_ambient.SetAmbience(uid, true);
@@ -376,9 +374,9 @@ public sealed class ThrusterSystem : EntitySystem
_appearance.SetData(uid, ThrusterVisualState.State, false, appearance);
}
if (EntityManager.TryGetComponent(uid, out PointLightComponent? pointLightComponent))
if (_light.TryGetLight(uid, out var pointLightComponent))
{
pointLightComponent.Enabled = false;
_light.SetEnabled(uid, false, pointLightComponent);
}
_ambient.SetAmbience(uid, false);