From 08dc193e538cd685be9e0eeb079f9caed9e225b9 Mon Sep 17 00:00:00 2001 From: steinarh Date: Thu, 2 Oct 2008 23:54:22 +0000 Subject: [PATCH] clearer this way? --- src/server.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) 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; + } } }