removes componentdependencies (#6160)

This commit is contained in:
Paul Ritter
2022-01-15 03:26:37 +01:00
committed by GitHub
parent 46405ec165
commit 9e1607722d
33 changed files with 257 additions and 274 deletions

View File

@@ -32,11 +32,5 @@ namespace Content.Server.Light.Components
/// Sound played when you ignite the matchstick.
/// </summary>
[DataField("igniteSound", required: true)] public SoundSpecifier IgniteSound = default!;
/// <summary>
/// Point light component. Gives matches a glow in dark effect.
/// </summary>
[ComponentDependency]
public readonly PointLightComponent? PointLightComponent = default!;
}
}

View File

@@ -6,6 +6,7 @@ using Content.Shared.Interaction;
using Content.Shared.Item;
using Content.Shared.Smoking;
using Content.Shared.Temperature;
using Robust.Server.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
@@ -85,9 +86,9 @@ namespace Content.Server.Light.EntitySystems
{
component.CurrentState = value;
if (component.PointLightComponent != null)
if (TryComp<PointLightComponent>(component.Owner, out var pointLightComponent))
{
component.PointLightComponent.Enabled = component.CurrentState == SmokableState.Lit;
pointLightComponent.Enabled = component.CurrentState == SmokableState.Lit;
}
if (EntityManager.TryGetComponent(component.Owner, out SharedItemComponent? item))