File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed
com.unity.netcode.gameobjects Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments