add manual page, Berkeley specific copyright
[unix-history] / usr / src / games / trek / klmove.c
index 513b0cc..66f0628 100644 (file)
@@ -1,6 +1,23 @@
+/*
+ * Copyright (c) 1980 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
 #ifndef lint
 #ifndef lint
-static char sccsid[] = "@(#)klmove.c   4.1     (Berkeley)      %G%";
-#endif not lint
+static char sccsid[] = "@(#)klmove.c   5.3 (Berkeley) %G%";
+#endif /* not lint */
 
 # include      "trek.h"
 
 
 # include      "trek.h"
 
@@ -55,7 +72,7 @@ int   fl;
                        continue;
                /* compute distance to move */
                motion = ranf(75) - 25;
                        continue;
                /* compute distance to move */
                motion = ranf(75) - 25;
-               motion =* k->avgdist * Param.movefac[2 * Move.newquad + fl];
+               motion *= k->avgdist * Param.movefac[2 * Move.newquad + fl];
                /* compute direction */
                dx = Ship.sectx - k->x + ranf(3) - 1;
                dy = Ship.secty - k->y + ranf(3) - 1;
                /* compute direction */
                dx = Ship.sectx - k->x + ranf(3) - 1;
                dy = Ship.secty - k->y + ranf(3) - 1;
@@ -86,15 +103,15 @@ int        fl;
                                qx = Ship.quadx;
                                qy = Ship.quady;
                                if (lookx < 0)
                                qx = Ship.quadx;
                                qy = Ship.quady;
                                if (lookx < 0)
-                                       qx =- 1;
+                                       qx -= 1;
                                else
                                        if (lookx >= NSECTS)
                                else
                                        if (lookx >= NSECTS)
-                                               qx =+ 1;
+                                               qx += 1;
                                if (looky < 0)
                                if (looky < 0)
-                                       qy =- 1;
+                                       qy -= 1;
                                else
                                        if (looky >= NSECTS)
                                else
                                        if (looky >= NSECTS)
-                                               qy =+ 1;
+                                               qy += 1;
                                if (qx < 0 || qx >= NQUADS || qy < 0 || qy >= NQUADS ||
                                                Quad[qx][qy].stars < 0 || Quad[qx][qy].klings > MAXKLQUAD - 1)
                                        break;
                                if (qx < 0 || qx >= NQUADS || qy < 0 || qy >= NQUADS ||
                                                Quad[qx][qy].stars < 0 || Quad[qx][qy].klings > MAXKLQUAD - 1)
                                        break;
@@ -104,16 +121,16 @@ int       fl;
                                                k->x, k->y, qx, qy);
                                        motion = Quad[qx][qy].scanned;
                                        if (motion >= 0 && motion < 1000)
                                                k->x, k->y, qx, qy);
                                        motion = Quad[qx][qy].scanned;
                                        if (motion >= 0 && motion < 1000)
-                                               Quad[qx][qy].scanned =+ 100;
+                                               Quad[qx][qy].scanned += 100;
                                        motion = Quad[Ship.quadx][Ship.quady].scanned;
                                        if (motion >= 0 && motion < 1000)
                                        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;
                                }
                                Sect[k->x][k->y] = EMPTY;
-                               Quad[qx][qy].klings =+ 1;
-                               Etc.nkling =- 1;
+                               Quad[qx][qy].klings += 1;
+                               Etc.nkling -= 1;
                                bmove(&Etc.klingon[Etc.nkling], k, sizeof *k);
                                bmove(&Etc.klingon[Etc.nkling], k, sizeof *k);
-                               Quad[Ship.quadx][Ship.quady].klings =- 1;
+                               Quad[Ship.quadx][Ship.quady].klings -= 1;
                                k = 0;
                                break;
                        }
                                k = 0;
                                break;
                        }