Instrument checks connection status before sending stop component message.

This commit is contained in:
Vera Aguilera Puerto 2021-07-11 11:07:16 +02:00
parent abfffbd863
commit d8bfb7c054
1 changed files with 2 additions and 1 deletions

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using Content.Shared.Instruments;
using Content.Shared.Physics;
using Robust.Client;
using Robust.Client.Audio.Midi;
using Robust.Shared.Audio.Midi;
using Robust.Shared.GameObjects;
@ -255,7 +256,7 @@ namespace Content.Client.Instruments
_renderer = null;
_midiEventBuffer.Clear();
if (!fromStateChange)
if (!fromStateChange && IoCManager.Resolve<INetManager>().IsConnected)
{
SendNetworkMessage(new InstrumentStopMidiMessage());
}