mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: SendChangeOwnerMessage robustness
- Check netid == 0 - Check conn is observing the identity Fixes #2988
This commit is contained in:
parent
b854a8a6f1
commit
d6d0ec88d0
@ -956,7 +956,12 @@ internal static void SendSpawnMessage(NetworkIdentity identity, NetworkConnectio
|
||||
|
||||
internal static void SendChangeOwnerMessage(NetworkIdentity identity, NetworkConnection conn)
|
||||
{
|
||||
if (identity.serverOnly) return;
|
||||
// Don't send if identity isn't spawned or only exists on server
|
||||
if (identity.netId == 0 || identity.serverOnly) return;
|
||||
|
||||
// Don't send if conn doesn't have the identity spawned yet
|
||||
// May be excluded from the client by interest management
|
||||
if (!conn.observing.Contains(identity)) return;
|
||||
|
||||
//Debug.Log($"Server SendChangeOwnerMessage: name={identity.name} netid={identity.netId}");
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user