From f3f0ef299e0b485fc37163abf6fb844dcc5f4b97 Mon Sep 17 00:00:00 2001 From: vis2k Date: Sun, 14 Apr 2019 12:40:16 +0200 Subject: [PATCH] clear sceneid if it was a duplicate --- Assets/Mirror/Runtime/NetworkIdentity.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Assets/Mirror/Runtime/NetworkIdentity.cs b/Assets/Mirror/Runtime/NetworkIdentity.cs index 7ee53308b..b98f69040 100644 --- a/Assets/Mirror/Runtime/NetworkIdentity.cs +++ b/Assets/Mirror/Runtime/NetworkIdentity.cs @@ -274,6 +274,9 @@ void AssignSceneID() bool duplicate = sceneIds.TryGetValue(m_SceneId, out existing) && existing != null && existing != this; if (m_SceneId == 0 || duplicate) { + // clear in any case, because it might have been a duplicate + m_SceneId = 0; + // if a scene was never opened and we are building it, then a // sceneId would be assigned to build but not saved in editor, // resulting in them getting out of sync.