Quick fix for some maps not loading in singleplayer.

This commit is contained in:
UnknownShadow200 2016-04-05 22:06:57 +10:00
parent ea997f2eae
commit 221dff8081
2 changed files with 8 additions and 6 deletions

View File

@ -69,7 +69,8 @@ namespace ClassicalSharp.Gui {
}
} catch( Exception ex ) {
ErrorHandler.LogError( "loading map", ex );
game.Chat.Add( "&e/client loadmap: Failed to load map \"" + path + "\"" );
string file = Path.GetFileName( path );
game.Chat.Add( "&e/client loadmap: Failed to load map \"" + file + "\"" );
}
}
}

View File

@ -74,14 +74,16 @@ namespace ClassicalSharp.Renderers {
}
public void Refresh() {
if( chunks != null && !game.World.IsNotLoaded ) {
ClearChunkCache();
CreateChunkCache();
}
chunkPos = new Vector3I( int.MaxValue );
if( chunks == null || game.World.IsNotLoaded ) return;
ClearChunkCache();
CreateChunkCache();
}
void RefreshBorders( int clipLevel ) {
chunkPos = new Vector3I( int.MaxValue );
if( chunks == null || game.World.IsNotLoaded ) return;
int index = 0;
for( int z = 0; z < chunksZ; z++ )
for( int y = 0; y < chunksY; y++ )
@ -92,7 +94,6 @@ namespace ClassicalSharp.Renderers {
DeleteChunk( unsortedChunks[index] );
index++;
}
chunkPos = new Vector3I( int.MaxValue );
}
void EnvVariableChanged( object sender, EnvVarEventArgs e ) {