Be slightly more harsh with dropped batches count to prevent abuse.

This commit is contained in:
zumorica
2020-05-21 20:11:09 +02:00
parent fc0d54a6bb
commit 9b0bc818c6

View File

@@ -118,7 +118,6 @@ namespace Content.Server.GameObjects.Components.Instruments
break;
case InstrumentStartMidiMessage startMidi:
Playing = true;
_batchesDropped = 0;
break;
case InstrumentStopMidiMessage stopMidi:
Playing = false;
@@ -202,6 +201,7 @@ namespace Content.Server.GameObjects.Components.Instruments
if (_batchesDropped > MaxMidiBatchDropped && _instrumentPlayer != null)
{
_batchesDropped = 0;
var mob = _instrumentPlayer.AttachedEntity;
if (mob.TryGetComponent(out StunnableComponent stun))
stun.Stun(1);