diff --git a/Content.Server/GameObjects/Components/Instruments/InstrumentComponent.cs b/Content.Server/GameObjects/Components/Instruments/InstrumentComponent.cs index ca6e19e3b8..868a74465e 100644 --- a/Content.Server/GameObjects/Components/Instruments/InstrumentComponent.cs +++ b/Content.Server/GameObjects/Components/Instruments/InstrumentComponent.cs @@ -114,8 +114,9 @@ namespace Content.Server.GameObjects.Components.Instruments private void OnPlayerStatusChanged(object sender, SessionStatusEventArgs e) { - if (e.NewStatus == SessionStatus.Disconnected) - InstrumentPlayer = null; + if (e.Session != _instrumentPlayer || e.NewStatus != SessionStatus.Disconnected) return; + InstrumentPlayer = null; + Clean(); } public override void Initialize() @@ -204,9 +205,13 @@ namespace Content.Server.GameObjects.Components.Instruments _lastSequencerTick = Math.Max(maxTick, minTick + 1); break; case InstrumentStartMidiMessage startMidi: + if (session != _instrumentPlayer) + break; Playing = true; break; case InstrumentStopMidiMessage stopMidi: + if (session != _instrumentPlayer) + break; Playing = false; Clean(); break; @@ -296,6 +301,7 @@ namespace Content.Server.GameObjects.Components.Instruments if (_instrumentPlayer != null && !ActionBlockerSystem.CanInteract(_instrumentPlayer.AttachedEntity)) { InstrumentPlayer = null; + Clean(); } if ((_batchesDropped >= MaxMidiBatchDropped diff --git a/Content.Server/GameObjects/Components/Interactable/ToolComponent.cs b/Content.Server/GameObjects/Components/Interactable/ToolComponent.cs index 707e984ca8..d2adaaa212 100644 --- a/Content.Server/GameObjects/Components/Interactable/ToolComponent.cs +++ b/Content.Server/GameObjects/Components/Interactable/ToolComponent.cs @@ -3,33 +3,14 @@ using System; using System.Collections.Generic; -using System.Linq; -using System.Reflection.Metadata.Ecma335; -using Content.Server.GameObjects.Components.Chemistry; -using Content.Server.GameObjects.EntitySystems; using Content.Shared.Audio; -using Content.Shared.Chemistry; -using Content.Shared.GameObjects; -using Content.Shared.GameObjects.Components; using Content.Shared.GameObjects.Components.Interactable; using Content.Shared.GameObjects.EntitySystems; -using Content.Shared.Maps; -using Robust.Server.GameObjects; using Robust.Server.GameObjects.EntitySystems; -using Robust.Shared.Audio; using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Map; -using Robust.Shared.Interfaces.Random; -using Robust.Shared.IoC; -using Robust.Shared.Localization; -using Robust.Shared.Log; -using Robust.Shared.Map; -using Robust.Shared.Prototypes; -using Robust.Shared.Random; using Robust.Shared.Serialization; -using Robust.Shared.Utility; using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Interactable