Skip to content

Commit

Permalink
ForceReload is always true, and the only use of it requred it to be f…
Browse files Browse the repository at this point in the history
…alse, so it's no longer needed. (MirrorNetworking#970)
  • Loading branch information
MrGadget authored and vis2k committed Jul 20, 2019
1 parent 3fb0337 commit 7fecfe3
Showing 1 changed file with 5 additions and 15 deletions.
20 changes: 5 additions & 15 deletions Assets/Mirror/Runtime/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public enum PlayerSpawnMethod
[HelpURL("https://vis2k.github.io/Mirror/Components/NetworkManager")]
public class NetworkManager : MonoBehaviour
{

// configuration
[FormerlySerializedAs("m_DontDestroyOnLoad")] public bool dontDestroyOnLoad = true;
[FormerlySerializedAs("m_RunInBackground")] public bool runInBackground = true;
Expand Down Expand Up @@ -411,7 +410,7 @@ public void StopClient()
if (!string.IsNullOrEmpty(offlineScene))
{
// Must pass true or offlineScene will not be loaded
ClientChangeScene(offlineScene, true);
ClientChangeScene(offlineScene);
}
CleanupNetworkIdentities();
}
Expand Down Expand Up @@ -458,12 +457,12 @@ void CleanupNetworkIdentities()
}
}

void ClientChangeScene(string newSceneName, bool forceReload)
void ClientChangeScene(string newSceneName)
{
ClientChangeScene(newSceneName, forceReload, LoadSceneMode.Single, LocalPhysicsMode.None);
ClientChangeScene(newSceneName, LoadSceneMode.Single, LocalPhysicsMode.None);
}

internal void ClientChangeScene(string newSceneName, bool forceReload, LoadSceneMode sceneMode, LocalPhysicsMode physicsMode)
internal void ClientChangeScene(string newSceneName, LoadSceneMode sceneMode, LocalPhysicsMode physicsMode)
{
if (string.IsNullOrEmpty(newSceneName))
{
Expand All @@ -473,15 +472,6 @@ internal void ClientChangeScene(string newSceneName, bool forceReload, LoadScene

if (LogFilter.Debug) Debug.Log("ClientChangeScene newSceneName:" + newSceneName + " networkSceneName:" + networkSceneName);

if (newSceneName == networkSceneName)
{
if (!forceReload)
{
FinishLoadScene();
return;
}
}

// vis2k: pause message handling while loading scene. otherwise we will process messages and then lose all
// the state as soon as the load is finishing, causing all kinds of bugs because of missing state.
// (client may be null after StopClient etc.)
Expand Down Expand Up @@ -671,7 +661,7 @@ void OnClientSceneInternal(NetworkConnection conn, SceneMessage msg)

if (NetworkClient.isConnected && !NetworkServer.active)
{
ClientChangeScene(msg.sceneName, true, msg.sceneMode, msg.physicsMode);
ClientChangeScene(msg.sceneName, msg.sceneMode, msg.physicsMode);
}
}
#endregion
Expand Down

0 comments on commit 7fecfe3

Please sign in to comment.