mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: #3362 BootstrapIdentity now initializes isClient/isLocalPlayer flags before calling OnStartAuthority
This commit is contained in:
parent
25ef55413c
commit
0312bf7103
@ -1351,13 +1351,15 @@ internal static void ChangeOwner(NetworkIdentity identity, ChangeOwnerMessage me
|
||||
// used to happen in multiple places, so let's have this in one function.
|
||||
static void BootstrapIdentity(NetworkIdentity identity)
|
||||
{
|
||||
identity.NotifyAuthority(); // calls OnStart/StopAuthority
|
||||
|
||||
// initialize flags.
|
||||
// after NotifyAuthority for compatibility with old behaviour.
|
||||
// initialize flags before invoking callbacks.
|
||||
// this way isClient/isLocalPlayer is correct during callbacks.
|
||||
// fixes: https://github.com/MirrorNetworking/Mirror/issues/3362
|
||||
identity.isClient = true;
|
||||
identity.isLocalPlayer = localPlayer == identity;
|
||||
|
||||
// invoke OnStartAuthority
|
||||
identity.NotifyAuthority();
|
||||
|
||||
// invoke OnStartClient
|
||||
identity.OnStartClient();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user