diff --git a/src/server.c b/src/server.c index 9834042..a67a8c6 100644 --- a/src/server.c +++ b/src/server.c @@ -51,22 +51,16 @@ laser(int side) { int ddir; switch (side) { case 0: - x=9; y=-1; dir=0; + x=9; y=0; dir=0; break; case 1: - x=0; y=8; dir=2; + x=0; y=7; dir=2; break; default: return 0; } for (;;) { - switch (dir & 3) { - case 0: y++; if (y>7) return 0; break; - case 1: x++; if (x>9) return 0; break; - case 2: y--; if (y<0) return 0; break; - case 3: x--; if (x<0) return 0; break; - } switch (board[x][y].piece) { case NONE: break; @@ -91,6 +85,12 @@ laser(int side) { dir=(dir + 1 - 2*(ddir & 1)) & 3; break; } + switch (dir & 3) { + case 0: y++; if (y>7) return 0; break; + case 1: x++; if (x>9) return 0; break; + case 2: y--; if (y<0) return 0; break; + case 3: x--; if (x<0) return 0; break; + } } }