NetworkClient.AddPlayer: remove dependency on .readyConnection. the code has a '!ready' check before. so by definition, .readyConnection == .connection here.

This commit is contained in:
vis2k 2021-03-11 11:14:21 +08:00
parent d299d607eb
commit 4c7a5d64a5

View File

@ -837,14 +837,14 @@ public static bool AddPlayer(NetworkConnection readyConn)
return false;
}
if (readyConnection.identity != null)
if (connection.identity != null)
{
Debug.LogError("NetworkClient.AddPlayer: a PlayerController was already added. Did you call AddPlayer twice?");
return false;
}
// Debug.Log("NetworkClient.AddPlayer() called with connection [" + readyConnection + "]");
readyConnection.Send(new AddPlayerMessage());
connection.Send(new AddPlayerMessage());
return true;
}