+/* $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
{
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;
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
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;