Remove some obsolete AppearanceComponent method usages (#13726)
This commit is contained in:
@@ -13,10 +13,12 @@ namespace Content.Server.Light.EntitySystems
|
||||
{
|
||||
public sealed class MatchstickSystem : EntitySystem
|
||||
{
|
||||
private HashSet<MatchstickComponent> _litMatches = new();
|
||||
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
|
||||
[Dependency] private readonly TransformSystem _transformSystem = default!;
|
||||
[Dependency] private readonly SharedItemSystem _item = default!;
|
||||
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
|
||||
|
||||
private HashSet<MatchstickComponent> _litMatches = new();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
@@ -61,7 +63,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
if (!isHotEvent.IsHot)
|
||||
return;
|
||||
|
||||
Ignite(component, args.User);
|
||||
Ignite(uid, component, args.User);
|
||||
args.Handled = true;
|
||||
}
|
||||
|
||||
@@ -70,23 +72,23 @@ namespace Content.Server.Light.EntitySystems
|
||||
args.IsHot = component.CurrentState == SmokableState.Lit;
|
||||
}
|
||||
|
||||
public void Ignite(MatchstickComponent component, EntityUid user)
|
||||
public void Ignite(EntityUid uid, MatchstickComponent component, EntityUid user)
|
||||
{
|
||||
// Play Sound
|
||||
SoundSystem.Play(component.IgniteSound.GetSound(), Filter.Pvs(component.Owner),
|
||||
component.Owner, AudioHelpers.WithVariation(0.125f).WithVolume(-0.125f));
|
||||
|
||||
// Change state
|
||||
SetState(component, SmokableState.Lit);
|
||||
SetState(uid, component, SmokableState.Lit);
|
||||
_litMatches.Add(component);
|
||||
component.Owner.SpawnTimer(component.Duration * 1000, delegate
|
||||
{
|
||||
SetState(component, SmokableState.Burnt);
|
||||
SetState(uid, component, SmokableState.Burnt);
|
||||
_litMatches.Remove(component);
|
||||
});
|
||||
}
|
||||
|
||||
private void SetState(MatchstickComponent component, SmokableState value)
|
||||
private void SetState(EntityUid uid, MatchstickComponent component, SmokableState value)
|
||||
{
|
||||
component.CurrentState = value;
|
||||
|
||||
@@ -110,7 +112,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
|
||||
if (EntityManager.TryGetComponent(component.Owner, out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(SmokingVisuals.Smoking, component.CurrentState);
|
||||
_appearance.SetData(uid, SmokingVisuals.Smoking, component.CurrentState, appearance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user