mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: NetworkIdentity.SetClientOwner: overwriting the owner was still possible even though it shouldn't be. all caller functions double check and return early if it already has an owner, so we should do the same here.
This commit is contained in:
parent
1a9625ee4a
commit
548db52fdf
@ -206,10 +206,14 @@ internal set
|
||||
// used when adding players
|
||||
internal void SetClientOwner(NetworkConnection conn)
|
||||
{
|
||||
// do nothing if it already has an owner
|
||||
if (connectionToClient != null && conn != connectionToClient)
|
||||
{
|
||||
Debug.LogError($"Object {this} netId={netId} already has an owner. Use RemoveClientAuthority() first", this);
|
||||
return;
|
||||
}
|
||||
|
||||
// otherwise set the owner connection
|
||||
connectionToClient = (NetworkConnectionToClient)conn;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user