Skip to content

Commit

Permalink
Merge pull request #40 from Sewer56/master
Browse files Browse the repository at this point in the history
Bugfix: Handle all custom messages in NKMultiConnection.Receive
  • Loading branch information
doombubbles authored Jun 2, 2022
2 parents 8eb4c56 + 8987adc commit 655152b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ internal static void Postfix(NKMultiConnection __instance)
var messageQueue = __instance.ReceiveQueue;
if (messageQueue == null || messageQueue.Count == 0)
return;

for (int i = 0; i < messageQueue.Count; i++)

var messageCount = messageQueue.Count;
for (int i = 0; i < messageCount; i++)
{
var message = messageQueue.Dequeue();
bool consumed = false;
Expand All @@ -28,5 +29,4 @@ internal static void Postfix(NKMultiConnection __instance)
}
}
}

}

0 comments on commit 655152b

Please sign in to comment.