]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - trek/move.c
Add braces to make the new egcs happy.
[bsdgames-darwin.git] / trek / move.c
index 68bc9dc85461034cfcf1a08f230877088482992f..c9d297a6c4e19fef342249042bcb3a00196e7e55 100644 (file)
@@ -1,6 +1,8 @@
+/*     $NetBSD: move.c,v 1.5 1998/08/30 09:19:40 veego 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[] = "@(#)move.c     5.4 (Berkeley) 6/1/90";
+#if 0
+static char sccsid[] = "@(#)move.c     8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: move.c,v 1.5 1998/08/30 09:19:40 veego Exp $");
+#endif
 #endif /* not lint */
 
-# include      "trek.h"
+#include <stdio.h>
+#include <math.h>
+#include "trek.h"
 
 /*
 **  Move Under Warp or Impulse Power
@@ -80,10 +89,10 @@ double      speed;
 {
        double                  angle;
        double                  x, y, dx, dy;
-       register int            ix, iy;
+       int             ix = 0, iy = 0;
        double                  bigger;
        int                     n;
-       register int            i;
+       int             i;
        double                  dist;
        double                  sectsize;
        double                  xn;
@@ -116,7 +125,7 @@ double      speed;
        evtime = Now.eventptr[E_LRTB]->date - Now.date;
 #      ifdef xTRACE
        if (Trace)
-               printf("E.ep = %u, ->evcode = %d, ->date = %.2f, evtime = %.2f\n",
+               printf("E.ep = %p, ->evcode = %d, ->date = %.2f, evtime = %.2f\n",
                        Now.eventptr[E_LRTB], Now.eventptr[E_LRTB]->evcode,
                        Now.eventptr[E_LRTB]->date, evtime);
 #      endif
@@ -177,13 +186,13 @@ double    speed;
                        Ship.quady = iy / NSECTS;
                        Ship.sectx = ix % NSECTS;
                        Ship.secty = iy % NSECTS;
-                       if (ix < 0 || Ship.quadx >= NQUADS || iy < 0 || Ship.quady >= NQUADS)
-                               if (!damaged(COMPUTER))
-                               {
+                       if (ix < 0 || Ship.quadx >= NQUADS || iy < 0 ||
+                           Ship.quady >= NQUADS) {
+                               if (!damaged(COMPUTER)) {
                                        dumpme(0);
-                               }
-                               else
+                               } else
                                        lose(L_NEGENB);
+                       }
                        initquad(0);
                        n = 0;
                        break;