]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - trek/klmove.c
cgram: rewrite completely, fixing bugs and style
[bsdgames-darwin.git] / trek / klmove.c
index 328b8a86b12760757058c521ad4cd1dfdfb872a7..4963f6be265c93fc572259a610c7092fe420053d 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: klmove.c,v 1.8 2009/05/24 21:44:56 dholland Exp $      */
+/*     $NetBSD: klmove.c,v 1.9 2009/05/24 22:55:03 dholland Exp $      */
 
 /*
  * Copyright (c) 1980, 1993
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)klmove.c   8.1 (Berkeley) 5/31/93";
 #else
-__RCSID("$NetBSD: klmove.c,v 1.8 2009/05/24 21:44:56 dholland Exp $");
+__RCSID("$NetBSD: klmove.c,v 1.9 2009/05/24 22:55:03 dholland Exp $");
 #endif
 #endif /* not lint */
 
@@ -114,7 +114,8 @@ klmove(int fl)
                for (; motion > 0; motion--) {
                        lookx = nextx + dx;
                        looky = nexty + dy;
-                       if (lookx < 0 || lookx >= NSECTS || looky < 0 || looky >= NSECTS) {
+                       if (lookx < 0 || lookx >= NSECTS ||
+                           looky < 0 || looky >= NSECTS) {
                                /* new quadrant */
                                qx = Ship.quadx;
                                qy = Ship.quady;
@@ -128,18 +129,23 @@ klmove(int fl)
                                else
                                        if (looky >= NSECTS)
                                                qy += 1;
-                               if (qx < 0 || qx >= NQUADS || qy < 0 || qy >= NQUADS ||
-                                               Quad[qx][qy].stars < 0 || Quad[qx][qy].klings > MAXKLQUAD - 1)
+                               if (qx < 0 || qx >= NQUADS ||
+                                   qy < 0 || qy >= NQUADS ||
+                                   Quad[qx][qy].stars < 0 ||
+                                   Quad[qx][qy].klings > MAXKLQUAD - 1)
                                        break;
                                if (!damaged(SRSCAN)) {
-                                       printf("Klingon at %d,%d escapes to quadrant %d,%d\n",
+                                       printf("Klingon at %d,%d escapes to "
+                                              "quadrant %d,%d\n",
                                                k->x, k->y, qx, qy);
                                        motion = Quad[qx][qy].scanned;
                                        if (motion >= 0 && motion < 1000)
                                                Quad[qx][qy].scanned += 100;
-                                       motion = Quad[Ship.quadx][Ship.quady].scanned;
+                                       motion = Quad[Ship.quadx][Ship.quady]
+                                               .scanned;
                                        if (motion >= 0 && motion < 1000)
-                                               Quad[Ship.quadx][Ship.quady].scanned -= 100;
+                                               Quad[Ship.quadx][Ship.quady]
+                                                       .scanned -= 100;
                                }
                                Sect[k->x][k->y] = EMPTY;
                                Quad[qx][qy].klings += 1;
@@ -156,7 +162,8 @@ klmove(int fl)
                                if (Sect[lookx][looky] != EMPTY) {
                                        fudgex = -fudgex;
                                        looky = nexty + fudgey;
-                                       if (looky < 0 || looky >= NSECTS || Sect[lookx][looky] != EMPTY) {
+                                       if (looky < 0 || looky >= NSECTS ||
+                                           Sect[lookx][looky] != EMPTY) {
                                                fudgey = -fudgey;
                                                break;
                                        }