mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
NetworkClient.ClearLocalPlayer removed. clear it directly instead.
This commit is contained in:
parent
9cf4207819
commit
251d3cd392
@ -818,14 +818,6 @@ internal static void InternalAddPlayer(NetworkIdentity identity)
|
||||
else Debug.LogWarning("No ready connection found for setting player controller during InternalAddPlayer");
|
||||
}
|
||||
|
||||
// Sets localPlayer to null. Should be called when the local player
|
||||
// object is destroyed.
|
||||
internal static void ClearLocalPlayer()
|
||||
{
|
||||
//Debug.Log("NetworkClient.ClearLocalPlayer");
|
||||
localPlayer = null;
|
||||
}
|
||||
|
||||
/// <summary>Sends AddPlayer message to the server, indicating that we want to join the world.</summary>
|
||||
public static bool AddPlayer()
|
||||
{
|
||||
|
@ -549,7 +549,7 @@ void OnDestroy()
|
||||
// still points to US!
|
||||
// => see also: https://github.com/vis2k/Mirror/issues/2635
|
||||
if (NetworkClient.localPlayer == this)
|
||||
NetworkClient.ClearLocalPlayer();
|
||||
NetworkClient.localPlayer = null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1148,7 +1148,7 @@ internal void Reset()
|
||||
// see OnDestroy() comments. it does the same.
|
||||
// (https://github.com/vis2k/Mirror/issues/2635)
|
||||
if (NetworkClient.localPlayer == this)
|
||||
NetworkClient.ClearLocalPlayer();
|
||||
NetworkClient.localPlayer = null;
|
||||
}
|
||||
isLocalPlayer = false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user