Skip to content

Commit e5d639a

Browse files
Merge branch 'release/2.4.3' into chore/merge-2-4-3-back-to-develop-2-0-0
2 parents fb7712d + 31017e2 commit e5d639a

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

com.unity.netcode.gameobjects/Runtime/Connection/NetworkConnectionManager.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1177,8 +1177,7 @@ internal void OnClientDisconnectFromServer(ulong clientId)
11771177
if (ownedObject)
11781178
{
11791179
// If destroying with owner, then always despawn and destroy (or defer destroying to prefab handler)
1180-
// Handle an object with no observers other than the current disconnecting client as destroying with owner
1181-
if (!ownedObject.DontDestroyWithOwner && (ownedObject.Observers.Count == 0 || (ownedObject.Observers.Count >= 1 && ownedObject.Observers.Contains(clientId))))
1180+
if (!ownedObject.DontDestroyWithOwner)
11821181
{
11831182
if (NetworkManager.PrefabHandler.ContainsHandler(ownedObject.GlobalObjectIdHash))
11841183
{
@@ -1244,7 +1243,7 @@ internal void OnClientDisconnectFromServer(ulong clientId)
12441243
}
12451244

12461245
// Skip destroy with owner objects as they will be processed by the outer loop
1247-
if (!childObject.DontDestroyWithOwner && (childObject.Observers.Count == 0 || (childObject.Observers.Count == 1 && childObject.Observers.Contains(clientId))))
1246+
if (!childObject.DontDestroyWithOwner)
12481247
{
12491248
continue;
12501249
}

0 commit comments

Comments
 (0)