Instruments respect MIDI limits by default again.
Cleans up the limit stun.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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; }
|
||||
|
||||
@@ -236,6 +236,7 @@
|
||||
- type: Instrument
|
||||
allowPercussion: true
|
||||
allowProgramChange: true
|
||||
respectMidiLimits: false
|
||||
- type: Sprite
|
||||
sprite: Objects/Fun/Instruments/h_synthesizer.rsi
|
||||
state: icon
|
||||
|
||||
Reference in New Issue
Block a user