mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-13 09:35:23 -04:00
Fix bug with right clicking attempting to place blocks outside boundaries of the map.
This commit is contained in:
parent
6970982ee8
commit
a223762e02
@ -143,9 +143,10 @@ namespace ClassicalSharp {
|
||||
}
|
||||
} else if( right ) {
|
||||
Vector3I pos = SelectedPos.TranslatedPos;
|
||||
if( !Map.IsValidPos( pos ) ) return;
|
||||
|
||||
Block block = HeldBlock;
|
||||
byte oldBlock = Map.IsValidPos( pos ) ? Map.GetBlock( pos ) : (byte)0;
|
||||
if( CanReplace( oldBlock ) && CanPlace[(int)block] ) {
|
||||
if( CanReplace( Map.GetBlock( pos ) ) && CanPlace[(int)block] ) {
|
||||
Network.SendSetBlock( pos.X, pos.Y, pos.Z, (byte)block );
|
||||
UpdateBlock( pos.X, pos.Y, pos.Z, (byte)block );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user