mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
fix: #640 InternalReplacePlayerForConnection calls SpawnObserversForConnection now too
This commit is contained in:
parent
a2d6317642
commit
bdf12c85d0
@ -686,6 +686,8 @@ public static bool AddPlayerForConnection(NetworkConnection conn, GameObject pla
|
|||||||
// add connection to observers AFTER the playerController was set.
|
// add connection to observers AFTER the playerController was set.
|
||||||
// by definition, there is nothing to observe if there is no player
|
// by definition, there is nothing to observe if there is no player
|
||||||
// controller.
|
// controller.
|
||||||
|
//
|
||||||
|
// IMPORTANT: do this in AddPlayerForConnection & ReplacePlayerForConnection!
|
||||||
SpawnObserversForConnection(conn);
|
SpawnObserversForConnection(conn);
|
||||||
|
|
||||||
if (SetupLocalPlayerForConnection(conn, identity))
|
if (SetupLocalPlayerForConnection(conn, identity))
|
||||||
@ -777,6 +779,13 @@ internal static bool InternalReplacePlayerForConnection(NetworkConnection conn,
|
|||||||
|
|
||||||
//NOTE: DONT set connection ready.
|
//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 (LogFilter.Debug) Debug.Log("NetworkServer ReplacePlayer setup local");
|
||||||
|
|
||||||
if (SetupLocalPlayerForConnection(conn, playerNetworkIdentity))
|
if (SetupLocalPlayerForConnection(conn, playerNetworkIdentity))
|
||||||
|
Loading…
Reference in New Issue
Block a user