Player should only be able to go outside map boundaries (except for flying above the map) when noclip is enabled, fixes #64.

This commit is contained in:
UnknownShadow200 2015-09-10 14:33:04 +10:00
parent a17cda3d3c
commit 061d9f7745

View File

@ -11,8 +11,8 @@ namespace ClassicalSharp {
protected BlockInfo info; protected BlockInfo info;
protected byte GetPhysicsBlockId( int x, int y, int z ) { protected byte GetPhysicsBlockId( int x, int y, int z ) {
if( x < 0 || x >= map.Width || z < 0 || z >= map.Length || y < 0 ) return (byte)Block.Bedrock;
if( y >= map.Height ) return (byte)Block.Air; if( y >= map.Height ) return (byte)Block.Air;
if( !map.IsValidPos( x, y, z ) ) return (byte)Block.Bedrock;
return map.GetBlock( x, y, z ); return map.GetBlock( x, y, z );
} }