Skip to content

Commit 7cca38b

Browse files
committed
Update CHANGELOG
1 parent d160e1b commit 7cca38b

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

com.unity.netcode.gameobjects/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Additional documentation and release notes are available at [Multiplayer Documen
2222

2323
### Fixed
2424

25+
- Ensure `NetworkBehaviour.IsSessionOwner` is correctly set when a new session owner is promoted. (#3817)
2526

2627
### Security
2728

com.unity.netcode.gameobjects/Runtime/Core/NetworkBehaviour.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,15 +1685,12 @@ public virtual void OnDestroy()
16851685
Debug.LogException(ex);
16861686
}
16871687

1688-
if (IsSpawned)
1688+
if (m_NetworkObject != null && m_NetworkObject.IsSpawned && IsSpawned)
16891689
{
1690-
if (m_NetworkObject != null && m_NetworkObject.IsSpawned)
1691-
{
1692-
// If the associated NetworkObject is still spawned then this
1693-
// NetworkBehaviour will be removed from the NetworkObject's
1694-
// ChildNetworkBehaviours list.
1695-
m_NetworkObject.OnNetworkBehaviourDestroyed(this);
1696-
}
1690+
// If the associated NetworkObject is still spawned then this
1691+
// NetworkBehaviour will be removed from the NetworkObject's
1692+
// ChildNetworkBehaviours list.
1693+
m_NetworkObject.OnNetworkBehaviourDestroyed(this);
16971694
}
16981695

16991696
// this seems odd to do here, but in fact especially in tests we can find ourselves

0 commit comments

Comments
 (0)