summaryrefslogtreecommitdiff
path: root/games/trek/move.c
diff options
context:
space:
mode:
Diffstat (limited to 'games/trek/move.c')
-rw-r--r--games/trek/move.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/games/trek/move.c b/games/trek/move.c
index b20faf218b8..2a0ac6e1466 100644
--- a/games/trek/move.c
+++ b/games/trek/move.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: move.c,v 1.2 1998/08/19 07:41:50 pjanzen Exp $ */
/* $NetBSD: move.c,v 1.3 1995/04/22 10:59:12 cgd Exp $ */
/*
@@ -37,11 +38,13 @@
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: move.c,v 1.3 1995/04/22 10:59:12 cgd Exp $";
+static char rcsid[] = "$OpenBSD: move.c,v 1.2 1998/08/19 07:41:50 pjanzen Exp $";
#endif
#endif /* not lint */
-# include "trek.h"
+#include <stdio.h>
+#include <math.h>
+#include "trek.h"
/*
** Move Under Warp or Impulse Power
@@ -78,15 +81,16 @@ static char rcsid[] = "$NetBSD: move.c,v 1.3 1995/04/22 10:59:12 cgd Exp $";
** Uses trace flag 4.
*/
-double move(ramflag, course, time, speed)
-int ramflag;
-int course;
-double time;
-double speed;
+double
+move(ramflag, course, time, speed)
+ int ramflag;
+ int course;
+ double time;
+ double speed;
{
double angle;
double x, y, dx, dy;
- register int ix, iy;
+ register int ix = 0, iy = 0;
double bigger;
int n;
register int i;
@@ -122,7 +126,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
@@ -184,12 +188,12 @@ double speed;
Ship.sectx = ix % NSECTS;
Ship.secty = iy % NSECTS;
if (ix < 0 || Ship.quadx >= NQUADS || iy < 0 || Ship.quady >= NQUADS)
+ {
if (!damaged(COMPUTER))
- {
dumpme(0);
- }
else
lose(L_NEGENB);
+ }
initquad(0);
n = 0;
break;