Fix two reported bugs: Client crashes when receiving block update while still loading a map (thanks Goodlyay), client doesn't remove player names from list when ExtPlayerList CPE extension is used (thanks 123DMWM)

This commit is contained in:
UnknownShadow200 2015-09-21 07:19:33 +10:00
parent 0f187cf5b0
commit fb566ac505

View File

@ -351,7 +351,10 @@ namespace ClassicalSharp {
int y = reader.ReadInt16();
int z = reader.ReadInt16();
byte type = reader.ReadUInt8();
game.UpdateBlock( x, y, z, type );
if( !game.Map.IsNotLoaded )
game.UpdateBlock( x, y, z, type );
else
Utils.LogWarning( "Server tried to update a block while still sending us the map!" );
} break;
case PacketId.AddEntity:
@ -513,6 +516,7 @@ namespace ClassicalSharp {
short nameId = reader.ReadInt16();
if( nameId >= 0 && nameId <= 255 ) {
game.RaiseCpeListInfoRemoved( (byte)nameId );
game.CpePlayersList[nameId] = null;
}
} break;