diff --git a/MLAPI/Data/NetworkingConfiguration.cs b/MLAPI/Data/NetworkingConfiguration.cs index 49f3f92..9237738 100644 --- a/MLAPI/Data/NetworkingConfiguration.cs +++ b/MLAPI/Data/NetworkingConfiguration.cs @@ -31,7 +31,7 @@ namespace MLAPI //TODO public bool EncryptMessages = false; public bool AllowPassthroughMessages = true; - public bool EnableSceneSwitching = true; + public bool EnableSceneSwitching = false; //Cached config hash private byte[] ConfigHash = null; diff --git a/MLAPI/NetworkingManagerComponents/NetworkSceneManager.cs b/MLAPI/NetworkingManagerComponents/NetworkSceneManager.cs index 3c5d9fa..7f5943d 100644 --- a/MLAPI/NetworkingManagerComponents/NetworkSceneManager.cs +++ b/MLAPI/NetworkingManagerComponents/NetworkSceneManager.cs @@ -18,6 +18,11 @@ namespace MLAPI.NetworkingManagerComponents internal static void SetCurrentSceneIndex () { + if(!sceneNameToIndex.ContainsKey(SceneManager.GetActiveScene().name)) + { + Debug.LogWarning("MLAPI: Scene switching is enabled but the current scene (" + SceneManager.GetActiveScene().name + ") is not regisered as a network scene."); + return; + } CurrentSceneIndex = sceneNameToIndex[SceneManager.GetActiveScene().name]; }