diff --git a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs index 6154da4728..11dca8db89 100644 --- a/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs +++ b/OpenSim/Region/ClientStack/LindenUDP/LLClientView.cs @@ -3476,13 +3476,16 @@ namespace OpenSim.Region.ClientStack.LindenUDP Lazy> compressedUpdateBlocks = new Lazy>(); Lazy> terseUpdateBlocks = new Lazy>(); + if (maxUpdates <= 0) maxUpdates = Int32.MaxValue; int updatesThisCall = 0; lock (m_entityUpdates.SyncRoot) { EntityUpdate update; - while (m_entityUpdates.TryDequeue(out update)) + while (updatesThisCall < maxUpdates && m_entityUpdates.TryDequeue(out update)) { + ++updatesThisCall; + #region UpdateFlags to packet type conversion PrimUpdateFlags updateFlags = update.Flags; @@ -3552,10 +3555,6 @@ namespace OpenSim.Region.ClientStack.LindenUDP } #endregion Block Construction - - ++updatesThisCall; - if (maxUpdates > 0 && updatesThisCall >= maxUpdates) - break; } }