Properly cleanup after disconnected, fix pause screen overriding error screen.

This commit is contained in:
UnknownShadow200 2015-04-30 06:44:21 +10:00
parent 92b8266e29
commit 00f20c7fa9
2 changed files with 5 additions and 1 deletions

View file

@ -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;

View file

@ -204,7 +204,6 @@ namespace ClassicalSharp {
public void Render( double deltaTime ) {
if( chunks == null ) return;
Window.Vertices = 0;
UpdateSortOrder();
UpdateChunks();