Prevent NetworkManager.ServerChangeScene from being called if a scene change is already in progress for that scene. (#2903)

This commit is contained in:
Devon Merner 2021-09-18 04:16:47 -04:00 committed by GitHub
parent 20056edc0f
commit 413b612856
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -750,6 +750,12 @@ public virtual void ServerChangeScene(string newSceneName)
return; return;
} }
if (NetworkServer.isLoadingScene && newSceneName == networkSceneName)
{
Debug.LogError("ServerChangeScene is already in progress for " + newSceneName);
return;
}
// Debug.Log("ServerChangeScene " + newSceneName); // Debug.Log("ServerChangeScene " + newSceneName);
NetworkServer.SetAllClientsNotReady(); NetworkServer.SetAllClientsNotReady();
networkSceneName = newSceneName; networkSceneName = newSceneName;