]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - trek/move.c
Fix bogus conditional caught by today's make. It looks as if MKHIDEGAME
[bsdgames-darwin.git] / trek / move.c
index eea64ccc87b55679eea113b1be414a6ed7749e27..d1941b53e738240a9ff45758a89752253f977f97 100644 (file)
@@ -1,6 +1,8 @@
+/*     $NetBSD: move.c,v 1.6 2003/08/07 09:37:52 agc 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
  * 2. Redistributions in binary form must reproduce the above copyright
  *    notice, this list of conditions and the following disclaimer in the
  *    documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- *    must display the following acknowledgement:
- *     This product includes software developed by the University of
- *     California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
+ * 3. Neither the name of the University nor the names of its contributors
  *    may be used to endorse or promote products derived from this software
  *    without specific prior written permission.
  *
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #ifndef lint
-/*static char sccsid[] = "from: @(#)move.c     5.4 (Berkeley) 6/1/90";*/
-static char rcsid[] = "$Id: move.c,v 1.2 1993/08/01 18:50:16 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)move.c     8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: move.c,v 1.6 2003/08/07 09:37:52 agc Exp $");
+#endif
 #endif /* not lint */
 
-# include      "trek.h"
+#include <stdio.h>
+#include <math.h>
+#include "trek.h"
 
 /*
 **  Move Under Warp or Impulse Power
@@ -81,10 +85,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;
@@ -117,7 +121,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
@@ -178,13 +182,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;