mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
Can't use TryPeek in older Unity
This commit is contained in:
parent
668dc91ffb
commit
3436df7ca4
@ -291,11 +291,10 @@ internal struct NetworkIdPool
|
||||
|
||||
internal static uint GetNextNetworkId()
|
||||
{
|
||||
if (poolNetworkIds && netIdPool.TryPeek(out NetworkIdPool entry) && entry.timeAvailable < NetworkTime.time)
|
||||
if (poolNetworkIds && netIdPool.Count > 0 && netIdPool.Peek().timeAvailable < NetworkTime.time)
|
||||
{
|
||||
NetworkIdPool entry = netIdPool.Dequeue();
|
||||
//Debug.LogFormat(LogType.Log, LogOption.NoStacktrace, null, $"[GetNextNetworkId] Reusing NetworkId {entry.poolNetId}.");
|
||||
|
||||
netIdPool.Dequeue();
|
||||
return entry.poolNetId;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user