diff --git a/Content.Server/Instruments/InstrumentSystem.cs b/Content.Server/Instruments/InstrumentSystem.cs index fbd379ac1c..e74d9e2832 100644 --- a/Content.Server/Instruments/InstrumentSystem.cs +++ b/Content.Server/Instruments/InstrumentSystem.cs @@ -155,20 +155,20 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem instrument.DirtyRenderer = false; } - if ((instrument.BatchesDropped >= MaxMidiBatchesDropped - || instrument.LaggedBatches >= MaxMidiLaggedBatches) - && instrument.InstrumentPlayer != null && instrument.RespectMidiLimits) + if (instrument.RespectMidiLimits && instrument.InstrumentPlayer != null && + (instrument.BatchesDropped >= MaxMidiBatchesDropped + || instrument.LaggedBatches >= MaxMidiLaggedBatches)) { - // Just in case - Clean((instrument).Owner); - instrument.UserInterface?.CloseAll(); - - if (instrument.InstrumentPlayer.AttachedEntity is {Valid: true} mob) + if (instrument.InstrumentPlayer?.AttachedEntity is {Valid: true} mob) { _stunSystem.TryParalyze(mob, TimeSpan.FromSeconds(1), true); - instrument.Owner.PopupMessage(mob, "instrument-component-finger-cramps-max-message"); + instrument.Owner.PopupMessage(mob, Loc.GetString("instrument-component-finger-cramps-max-message")); } + + // Just in case + Clean((instrument).Owner); + instrument.UserInterface?.CloseAll(); } instrument.Timer += frameTime; diff --git a/Content.Shared/Instruments/SharedInstrumentComponent.cs b/Content.Shared/Instruments/SharedInstrumentComponent.cs index 4918a7d693..dc99aa8eed 100644 --- a/Content.Shared/Instruments/SharedInstrumentComponent.cs +++ b/Content.Shared/Instruments/SharedInstrumentComponent.cs @@ -33,7 +33,7 @@ public class SharedInstrumentComponent : Component public bool AllowProgramChange { get ; set; } [DataField("respectMidiLimits"), ViewVariables(VVAccess.ReadWrite)] - public bool RespectMidiLimits { get; set; } + public bool RespectMidiLimits { get; set; } = true; [ViewVariables(VVAccess.ReadWrite)] public bool DirtyRenderer { get; set; } diff --git a/Resources/Prototypes/Entities/Objects/Fun/instruments.yml b/Resources/Prototypes/Entities/Objects/Fun/instruments.yml index 898f1c5eb0..04eb8c0567 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/instruments.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/instruments.yml @@ -236,6 +236,7 @@ - type: Instrument allowPercussion: true allowProgramChange: true + respectMidiLimits: false - type: Sprite sprite: Objects/Fun/Instruments/h_synthesizer.rsi state: icon