Skip to content

Commit

Permalink
fix: #640 InternalReplacePlayerForConnection calls SpawnObserversForC…
Browse files Browse the repository at this point in the history
…onnection now too
  • Loading branch information
miwarnec committed Mar 24, 2019
1 parent a2d6317 commit bdf12c8
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Assets/Mirror/Runtime/NetworkServer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,8 @@ public static bool AddPlayerForConnection(NetworkConnection conn, GameObject pla
// add connection to observers AFTER the playerController was set.
// by definition, there is nothing to observe if there is no player
// controller.
//
// IMPORTANT: do this in AddPlayerForConnection & ReplacePlayerForConnection!
SpawnObserversForConnection(conn);

if (SetupLocalPlayerForConnection(conn, identity))
Expand Down Expand Up @@ -777,6 +779,13 @@ internal static bool InternalReplacePlayerForConnection(NetworkConnection conn,

//NOTE: DONT set connection ready.

// add connection to observers AFTER the playerController was set.
// by definition, there is nothing to observe if there is no player
// controller.
//
// IMPORTANT: do this in AddPlayerForConnection & ReplacePlayerForConnection!
SpawnObserversForConnection(conn);

if (LogFilter.Debug) Debug.Log("NetworkServer ReplacePlayer setup local");

if (SetupLocalPlayerForConnection(conn, playerNetworkIdentity))
Expand Down

0 comments on commit bdf12c8

Please sign in to comment.