mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: ChangeOwner now adds/removes from owned hashset
We do this in spawn and destroy already.
This commit is contained in:
parent
3e7837cebd
commit
a35c0dbd9a
@ -1323,6 +1323,14 @@ internal static void ChangeOwner(NetworkIdentity identity, ChangeOwnerMessage me
|
||||
|
||||
// set ownership flag (aka authority)
|
||||
identity.isOwned = message.isOwner;
|
||||
|
||||
// Add / Remove to client's connectionToServer.owned hashset.
|
||||
if (identity.isOwned)
|
||||
connection?.owned.Add(identity);
|
||||
else
|
||||
connection?.owned.Remove(identity);
|
||||
|
||||
// Call OnStartAuthority / OnStopAuthority
|
||||
identity.NotifyAuthority();
|
||||
|
||||
// set localPlayer flag
|
||||
|
Loading…
Reference in New Issue
Block a user