diff --git a/engine/Sandbox.Engine/Scene/Networking/SceneNetworkSystem.cs b/engine/Sandbox.Engine/Scene/Networking/SceneNetworkSystem.cs index 395b98d9c..fb93eb67d 100644 --- a/engine/Sandbox.Engine/Scene/Networking/SceneNetworkSystem.cs +++ b/engine/Sandbox.Engine/Scene/Networking/SceneNetworkSystem.cs @@ -559,20 +559,23 @@ public override void OnLeave( Connection client ) system.LocalSnapshotState.RemoveConnection( client.Id ); } - Action queue = default; - - foreach ( var c in Game.ActiveScene.GetAll() ) - { - queue += () => c.OnDisconnected( client ); - } - - try - { - queue?.Invoke(); - } - catch ( Exception e ) + if ( Networking.IsHost ) { - Log.Error( e, "Exception when calling INetworkListener.OnDisconnected" ); + Action queue = default; + + foreach ( var c in Game.ActiveScene.GetAll() ) + { + queue += () => c.OnDisconnected( client ); + } + + try + { + queue?.Invoke(); + } + catch ( Exception e ) + { + Log.Error( e, "Exception when calling INetworkListener.OnDisconnected" ); + } } }