From 061d9f774591b1e60e75925beaa2588eed525853 Mon Sep 17 00:00:00 2001 From: UnknownShadow200 Date: Thu, 10 Sep 2015 14:33:04 +1000 Subject: [PATCH] Player should only be able to go outside map boundaries (except for flying above the map) when noclip is enabled, fixes #64. --- ClassicalSharp/Physics/Entity.Physics.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ClassicalSharp/Physics/Entity.Physics.cs b/ClassicalSharp/Physics/Entity.Physics.cs index d4f93d0ad..c29d01464 100644 --- a/ClassicalSharp/Physics/Entity.Physics.cs +++ b/ClassicalSharp/Physics/Entity.Physics.cs @@ -11,8 +11,8 @@ namespace ClassicalSharp { protected BlockInfo info; 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( !map.IsValidPos( x, y, z ) ) return (byte)Block.Bedrock; return map.GetBlock( x, y, z ); }