mirror of
https://github.com/MirrorNetworking/Mirror.git
synced 2024-11-18 02:50:32 +00:00
adding check before telling clients (#2010)
* adding check before telling clients * Update Assets/Mirror/Runtime/NetworkManager.cs Co-authored-by: MrGadget <chris@clevertech.net>
This commit is contained in:
parent
76d49c1e99
commit
8c1ed40c40
@ -824,8 +824,13 @@ public virtual void ServerChangeScene(string newSceneName)
|
||||
|
||||
loadingSceneAsync = SceneManager.LoadSceneAsync(newSceneName);
|
||||
|
||||
// notify all clients about the new scene
|
||||
NetworkServer.SendToAll(new SceneMessage { sceneName = newSceneName });
|
||||
// ServerChangeScene can be called when stopping the server
|
||||
// when this happens the server is not active so does not need to tell clients about the change
|
||||
if (NetworkServer.active)
|
||||
{
|
||||
// notify all clients about the new scene
|
||||
NetworkServer.SendToAll(new SceneMessage { sceneName = newSceneName });
|
||||
}
|
||||
|
||||
startPositionIndex = 0;
|
||||
startPositions.Clear();
|
||||
|
Loading…
Reference in New Issue
Block a user