mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
ChangeOwner comments
This commit is contained in:
parent
8bef2bf864
commit
303b66247e
@ -1288,14 +1288,15 @@ internal static void ChangeOwner(NetworkIdentity identity, ChangeOwnerMessage me
|
||||
|
||||
// set localPlayer flag
|
||||
identity.isLocalPlayer = message.isLocalPlayer;
|
||||
|
||||
// identity is now local player. set our static helper field to it.
|
||||
if (identity.isLocalPlayer)
|
||||
{
|
||||
localPlayer = identity;
|
||||
}
|
||||
// identity's isLocalPlayer was set false. was it local player before?
|
||||
else if (localPlayer == identity)
|
||||
{
|
||||
// localPlayer may already be assigned to something else
|
||||
// so only make it null if it's this identity.
|
||||
localPlayer = null;
|
||||
identity.OnStopLocalPlayer();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user