]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - trek/klmove.c
Don't chown installed files or directories if UNPRIVILEGED is defined.
[bsdgames-darwin.git] / trek / klmove.c
index 9419d3bdec25aaf03c8ca87009a4d59e91423f9e..1c03ccd97fe2bdaad51a12ca0506655d5ab2f89d 100644 (file)
@@ -1,6 +1,8 @@
+/*     $NetBSD: klmove.c,v 1.4 1997/10/12 21:24:57 christos Exp $      */
+
 /*
- * Copyright (c) 1980 Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1980, 1993
+ *     The Regents of the University of California.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #ifndef lint
-/*static char sccsid[] = "from: @(#)klmove.c   5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: klmove.c,v 1.2 1993/08/01 18:50:23 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)klmove.c   8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: klmove.c,v 1.4 1997/10/12 21:24:57 christos Exp $");
+#endif
 #endif /* not lint */
 
-# include      "trek.h"
+#include <stdio.h>
+#include "trek.h"
 
 /*
 **  Move Klingons Around
@@ -61,14 +68,15 @@ static char rcsid[] = "$Id: klmove.c,v 1.2 1993/08/01 18:50:23 mycroft Exp $";
 **     course around stars.
 */
 
+void
 klmove(fl)
 int    fl;
 {
        int                     n;
-       register struct kling   *k;
+       struct kling    *k;
        double                  dx, dy;
        int                     nextx, nexty;
-       register int            lookx, looky;
+       int             lookx, looky;
        int                     motion;
        int                     fudgex, fudgey;
        int                     qx, qy;
@@ -79,7 +87,7 @@ int   fl;
        if (Trace)
                printf("klmove: fl = %d, Etc.nkling = %d\n", fl, Etc.nkling);
 #      endif
-       for (n = 0; n < Etc.nkling; k && n++)
+       for (n = 0; n < Etc.nkling; n++)
        {
                k = &Etc.klingon[n];
                i = 100;
@@ -146,7 +154,7 @@ int fl;
                                Sect[k->x][k->y] = EMPTY;
                                Quad[qx][qy].klings += 1;
                                Etc.nkling -= 1;
-                               bmove(&Etc.klingon[Etc.nkling], k, sizeof *k);
+                               *k = Etc.klingon[Etc.nkling];
                                Quad[Ship.quadx][Ship.quady].klings -= 1;
                                k = 0;
                                break;