mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 11:00:32 +00:00
fix: NetworkIdentity.Reset resets isLocalPlayer AFTER the isLocalPlayer ClearLocalPlayer check. fixes a runtime UnSpawn test.
This commit is contained in:
parent
a23c01aa24
commit
accf843283
@ -1110,7 +1110,7 @@ internal void Reset()
|
|||||||
clientStarted = false;
|
clientStarted = false;
|
||||||
isClient = false;
|
isClient = false;
|
||||||
isServer = false;
|
isServer = false;
|
||||||
isLocalPlayer = false;
|
//isLocalPlayer = false; <- cleared AFTER ClearLocalPlayer below!
|
||||||
|
|
||||||
netId = 0;
|
netId = 0;
|
||||||
connectionToServer = null;
|
connectionToServer = null;
|
||||||
@ -1119,10 +1119,13 @@ internal void Reset()
|
|||||||
|
|
||||||
ClearObservers();
|
ClearObservers();
|
||||||
|
|
||||||
|
// clear local player if it was the local player,
|
||||||
|
// THEN reset isLocalPlayer AFTERWARDS
|
||||||
if (isLocalPlayer)
|
if (isLocalPlayer)
|
||||||
{
|
{
|
||||||
NetworkClient.ClearLocalPlayer();
|
NetworkClient.ClearLocalPlayer();
|
||||||
}
|
}
|
||||||
|
isLocalPlayer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear all component's dirty bits no matter what
|
// clear all component's dirty bits no matter what
|
||||||
|
Loading…
Reference in New Issue
Block a user