Cleanup microwave and ExpendableLight sound stop code.

Now this doesn't throw anymore, so no need to try catch it.
This commit is contained in:
Vera Aguilera Puerto
2021-09-20 11:24:28 +02:00
parent cda67df317
commit f1490f4d85
2 changed files with 2 additions and 16 deletions

View File

@@ -17,15 +17,8 @@ namespace Content.Client.Kitchen.EntitySystems
}
public void StopSoundLoop(MicrowaveComponent microwave)
{
try
{
microwave.PlayingStream?.Stop();
}
catch (Exception _)
{
// TODO: HOLY SHIT EXPOSE SOME DISPOSED PROPERTY ON PLAYING STREAM OR SOMETHING.
}
}
}
}

View File

@@ -38,16 +38,9 @@ namespace Content.Client.Light.Visualizers
}
void TryStopStream(IPlayingAudioStream? stream)
{
try
{
stream?.Stop();
}
catch (Exception _)
{
// TODO: HOLY SHIT EXPOSE SOME DISPOSED PROPERTY ON PLAYING STREAM OR SOMETHING.
}
}
if (component.TryGetData(ExpendableLightVisuals.State, out ExpendableLightState state)
&& component.Owner.TryGetComponent<ExpendableLightComponent>(out var expendableLight))