From 4c7a5d64a56fd162659001d503bdc891bf21559c Mon Sep 17 00:00:00 2001 From: vis2k Date: Thu, 11 Mar 2021 11:14:21 +0800 Subject: [PATCH] NetworkClient.AddPlayer: remove dependency on .readyConnection. the code has a '!ready' check before. so by definition, .readyConnection == .connection here. --- Assets/Mirror/Runtime/NetworkClient.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Mirror/Runtime/NetworkClient.cs b/Assets/Mirror/Runtime/NetworkClient.cs index 8f4fde75d..360511461 100644 --- a/Assets/Mirror/Runtime/NetworkClient.cs +++ b/Assets/Mirror/Runtime/NetworkClient.cs @@ -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; }