handheldlightsystem cleanup (#13402)

This commit is contained in:
Checkraze
2023-01-10 07:01:57 -05:00
committed by GitHub
parent a1e05a0a13
commit ec954dafc9
2 changed files with 11 additions and 8 deletions

View File

@@ -10,6 +10,8 @@ namespace Content.Client.Light;
public sealed class HandheldLightSystem : SharedHandheldLightSystem
{
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
public override void Initialize()
{
base.Initialize();
@@ -30,13 +32,12 @@ public sealed class HandheldLightSystem : SharedHandheldLightSystem
return;
}
if (!args.Component.TryGetData(ToggleableLightVisuals.Enabled, out bool enabled))
if (!_appearance.TryGetData(uid, ToggleableLightVisuals.Enabled, out bool enabled, args.Component))
{
return;
}
if (!args.Component.TryGetData(HandheldLightVisuals.Power,
out HandheldLightPowerStates state))
if (!_appearance.TryGetData(uid, HandheldLightVisuals.Power, out HandheldLightPowerStates state, args.Component))
{
return;
}