misc flare fixes (#12942)
This commit is contained in:
@@ -2,10 +2,6 @@ using Content.Client.Light.Components;
|
||||
using Content.Shared.Light.Component;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Player;
|
||||
|
||||
namespace Content.Client.Light.Visualizers
|
||||
{
|
||||
@@ -35,31 +31,21 @@ namespace Content.Client.Light.Visualizers
|
||||
}
|
||||
}
|
||||
|
||||
void TryStopStream(IPlayingAudioStream? stream)
|
||||
{
|
||||
stream?.Stop();
|
||||
}
|
||||
|
||||
if (component.TryGetData(ExpendableLightVisuals.State, out ExpendableLightState state)
|
||||
&& entities.TryGetComponent(component.Owner, out ExpendableLightComponent? expendableLight))
|
||||
&& entities.TryGetComponent(component.Owner, out ExpendableLightComponent? expendableLight))
|
||||
{
|
||||
switch (state)
|
||||
{
|
||||
case ExpendableLightState.Lit:
|
||||
{
|
||||
TryStopStream(expendableLight.PlayingStream);
|
||||
if (expendableLight.LoopedSound != null)
|
||||
{
|
||||
expendableLight.PlayingStream = SoundSystem.Play(expendableLight.LoopedSound, Filter.Local(),
|
||||
expendableLight.Owner, SharedExpendableLightComponent.LoopedSoundParams.WithLoop(true));
|
||||
}
|
||||
expendableLight.PlayingStream?.Stop();
|
||||
expendableLight.PlayingStream = entities.EntitySysManager.GetEntitySystem<SharedAudioSystem>().PlayPvs(
|
||||
expendableLight.LoopedSound,
|
||||
expendableLight.Owner,
|
||||
SharedExpendableLightComponent.LoopedSoundParams);
|
||||
break;
|
||||
}
|
||||
case ExpendableLightState.Dead:
|
||||
{
|
||||
TryStopStream(expendableLight.PlayingStream);
|
||||
expendableLight.PlayingStream?.Stop();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user