diff --git a/Game/Game.cs b/Game/Game.cs index ac57f4cab..240ab528c 100644 --- a/Game/Game.cs +++ b/Game/Game.cs @@ -212,6 +212,7 @@ namespace ClassicalSharp { accumulator += e.Time; imageCheckAccumulator += e.Time; ticksAccumulator += e.Time; + Vertices = 0; if( !Focused && !( activeScreen is PauseScreen ) && !Map.IsNotLoaded ) { SetNewScreen( new PauseScreen( this ) ); } @@ -341,6 +342,10 @@ namespace ClassicalSharp { public void Disconnect( string title, string reason ) { SetNewScreen( new ErrorScreen( this, title, reason ) ); + Map.Reset(); + RaiseOnNewMap(); + Map.mapData = null; + GC.Collect(); } Screen activeScreen; diff --git a/Rendering/MapRenderer.cs b/Rendering/MapRenderer.cs index 9b8ffb2e2..45435a09a 100644 --- a/Rendering/MapRenderer.cs +++ b/Rendering/MapRenderer.cs @@ -204,7 +204,6 @@ namespace ClassicalSharp { public void Render( double deltaTime ) { if( chunks == null ) return; - Window.Vertices = 0; UpdateSortOrder(); UpdateChunks();