From b5c587145303dd516b0f91577d4f8f975480a271 Mon Sep 17 00:00:00 2001 From: 20kdc Date: Wed, 1 Dec 2021 14:00:10 +0000 Subject: [PATCH] Fix a bunch of returns where they should not be (#5640) --- Content.Client/Instruments/InstrumentSystem.cs | 8 ++++---- Content.Server/Instruments/InstrumentSystem.cs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Content.Client/Instruments/InstrumentSystem.cs b/Content.Client/Instruments/InstrumentSystem.cs index 0240df877b..51419df143 100644 --- a/Content.Client/Instruments/InstrumentSystem.cs +++ b/Content.Client/Instruments/InstrumentSystem.cs @@ -322,7 +322,7 @@ namespace Content.Client.Instruments UpdateRenderer(instrument.OwnerUid, instrument); if (!instrument.IsMidiOpen && !instrument.IsInputOpen) - return; + continue; var now = _gameTiming.RealTime; var oneSecAGo = now.Add(OneSecAgo); @@ -333,7 +333,7 @@ namespace Content.Client.Instruments instrument.SentWithinASec = 0; } - if (instrument.MidiEventBuffer.Count == 0) return; + if (instrument.MidiEventBuffer.Count == 0) continue; var max = instrument.RespectMidiLimits ? Math.Min(MaxMidiEventsPerBatch, MaxMidiEventsPerSecond - instrument.SentWithinASec) @@ -342,7 +342,7 @@ namespace Content.Client.Instruments if (max <= 0) { // hit event/sec limit, have to lag the batch or drop events - return; + continue; } // fix cross-fade events generating retroactive events @@ -364,7 +364,7 @@ namespace Content.Client.Instruments var eventCount = events.Length; if (eventCount == 0) - return; + continue; RaiseNetworkEvent(new InstrumentMidiEventEvent(instrument.OwnerUid, events)); diff --git a/Content.Server/Instruments/InstrumentSystem.cs b/Content.Server/Instruments/InstrumentSystem.cs index c1e6b16dd9..8c93a55126 100644 --- a/Content.Server/Instruments/InstrumentSystem.cs +++ b/Content.Server/Instruments/InstrumentSystem.cs @@ -166,7 +166,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem instrument.Timer += frameTime; if (instrument.Timer < 1) - return; + continue; instrument.Timer = 0f; instrument.MidiEventCount = 0;