Skip to content

Commit

Permalink
fix: not sending unload message to host player
Browse files Browse the repository at this point in the history
  • Loading branch information
James-Frowen committed Nov 14, 2022
1 parent 99447d4 commit f1ace90
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions Assets/Mirage/Runtime/NetworkSceneManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -416,13 +416,10 @@ private void ServerSceneUnLoading(Scene scene, IEnumerable<INetworkPlayer> playe
SetAllClientsNotReady(players);
OnServerStartedSceneChange?.Invoke(scene.path, SceneOperation.UnloadAdditive);

// if not host
if (!Server.LocalClientActive)
UnLoadSceneAsync(scene, SceneOperation.UnloadAdditive).Forget();
UnLoadSceneAsync(scene, SceneOperation.UnloadAdditive).Forget();

// notify all clients about the new scene
var msg = new SceneMessage { MainActivateScene = scene.path, SceneOperation = SceneOperation.UnloadAdditive };
NetworkServer.SendToMany(players, msg);
SendSceneMessage(players, scene.path, SceneOperation.UnloadAdditive);
}

/// <summary>
Expand Down

0 comments on commit f1ace90

Please sign in to comment.