1
0
mirror of https://github.com/lidgren/lidgren-network-gen3.git synced 2026-05-16 15:16:33 +09:00

Fixed bug in WaitMessage() - when already queued message existed it would wait for next message to arrive anyway

This commit is contained in:
lidgren
2011-08-19 12:33:47 +00:00
parent 9a5704a582
commit 6a1654061e

View File

@@ -159,6 +159,9 @@ namespace Lidgren.Network
/// </summary>
public NetIncomingMessage WaitMessage(int maxMillis)
{
var msg = ReadMessage();
if (msg != null)
return msg; // no need to wait; we already have a message to deliver
if (m_messageReceivedEvent != null)
m_messageReceivedEvent.WaitOne(maxMillis);
return ReadMessage();