mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-01-23 01:21:57 -05:00
Properly cleanup after disconnected, fix pause screen overriding error screen.
This commit is contained in:
parent
92b8266e29
commit
00f20c7fa9
2 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -204,7 +204,6 @@ namespace ClassicalSharp {
|
|||
|
||||
public void Render( double deltaTime ) {
|
||||
if( chunks == null ) return;
|
||||
Window.Vertices = 0;
|
||||
UpdateSortOrder();
|
||||
UpdateChunks();
|
||||
|
||||
|
|
Loading…
Reference in a new issue