mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
fix: #3308 scene change NetworkClient.owned null entry. NetworkIdentity.OnDestroy now removes from owned. (#3325)
This commit is contained in:
parent
17c5a6c956
commit
100847cc31
@ -629,6 +629,20 @@ void OnDestroy()
|
||||
if (NetworkClient.localPlayer == this)
|
||||
NetworkClient.localPlayer = null;
|
||||
}
|
||||
|
||||
if (isClient)
|
||||
{
|
||||
// ServerChangeScene doesn't send destroy messages.
|
||||
// some identities may persist in DDOL.
|
||||
// some are destroyed by scene change.
|
||||
// if an identity is still in .owned, remove it.
|
||||
// fixes: https://github.com/MirrorNetworking/Mirror/issues/3308
|
||||
if (NetworkClient.connection != null &&
|
||||
NetworkClient.connection.owned.Contains(this))
|
||||
{
|
||||
NetworkClient.connection.owned.Remove(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void OnStartServer()
|
||||
|
Loading…
Reference in New Issue
Block a user