X-Git-Url: http://git.shiar.net/netris.git/blobdiff_plain/b5a9cdfd671a10cd5b5e9f1f53105e9993414247..5902d7f327fcf57d2b1a47f1b4a3aa98f4ab08a8:/board.c diff --git a/board.c b/board.c index c3a8d5c..7946d57 100644 --- a/board.c +++ b/board.c @@ -146,8 +146,8 @@ unsigned char GetBlock(int scr, int y, int x) void SetBlock(int scr, int y, int x, unsigned char type) { - if (y >= 0 && y < Players[scr].boardHeight && - x >= 0 && x < Players[scr].boardWidth) { + if (y >= 0 && y < Players[scr].boardHeight + && x >= 0 && x < Players[scr].boardWidth) { board[scr][y][x] = type; changed[scr][y] |= 1 << x; } @@ -237,7 +237,7 @@ int MovePiece(int scr, int deltaY, int deltaX) EraseShape(Players[scr].curShape, scr, Players[scr].curY, Players[scr].curX, 1); result = ShapeFits(Players[scr].curShape, scr, Players[scr].curY + deltaY, - Players[scr].curX + deltaX); + Players[scr].curX + deltaX); if (result) { Players[scr].curY += deltaY; Players[scr].curX += deltaX; @@ -268,7 +268,7 @@ int RotatePiece(int scr, int dir) } //try to fit if it doesn't if (result) Players[scr].curShape = newshape; PlotShape(Players[scr].curShape, scr, - Players[scr].curY, Players[scr].curX, scr == me); + Players[scr].curY, Players[scr].curX, scr == me); return result; } //RotatePiece @@ -279,7 +279,7 @@ int DropPiece(int scr) EraseShape(Players[scr].curShape, scr, Players[scr].curY, Players[scr].curX, 1); while (ShapeFits(Players[scr].curShape, scr, - Players[scr].curY - 1, Players[scr].curX)) { + Players[scr].curY - 1, Players[scr].curX)) { Players[scr].curY--; count++; }