Remove lights compref (#19531)
This commit is contained in:
@@ -14,9 +14,10 @@ namespace Content.Server.Light.EntitySystems
|
||||
public sealed class MatchstickSystem : EntitySystem
|
||||
{
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
||||
[Dependency] private readonly SharedItemSystem _item = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
[Dependency] private readonly SharedItemSystem _item = default!;
|
||||
[Dependency] private readonly SharedPointLightSystem _lights = default!;
|
||||
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
||||
|
||||
private HashSet<MatchstickComponent> _litMatches = new();
|
||||
|
||||
@@ -92,25 +93,25 @@ namespace Content.Server.Light.EntitySystems
|
||||
{
|
||||
component.CurrentState = value;
|
||||
|
||||
if (TryComp<PointLightComponent>(component.Owner, out var pointLightComponent))
|
||||
if (_lights.TryGetLight(uid, out var pointLightComponent))
|
||||
{
|
||||
pointLightComponent.Enabled = component.CurrentState == SmokableState.Lit;
|
||||
_lights.SetEnabled(uid, component.CurrentState == SmokableState.Lit, pointLightComponent);
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(component.Owner, out ItemComponent? item))
|
||||
if (EntityManager.TryGetComponent(uid, out ItemComponent? item))
|
||||
{
|
||||
switch (component.CurrentState)
|
||||
{
|
||||
case SmokableState.Lit:
|
||||
_item.SetHeldPrefix(component.Owner, "lit", item);
|
||||
_item.SetHeldPrefix(uid, "lit", item);
|
||||
break;
|
||||
default:
|
||||
_item.SetHeldPrefix(component.Owner, "unlit", item);
|
||||
_item.SetHeldPrefix(uid, "unlit", item);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (EntityManager.TryGetComponent(component.Owner, out AppearanceComponent? appearance))
|
||||
if (EntityManager.TryGetComponent(uid, out AppearanceComponent? appearance))
|
||||
{
|
||||
_appearance.SetData(uid, SmokingVisuals.Smoking, component.CurrentState, appearance);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user