-/* $NetBSD: move.c,v 1.9 2009/05/24 21:44:56 dholland Exp $ */
+/* $NetBSD: move.c,v 1.11 2011/07/03 06:44:01 mrg Exp $ */
/*
* Copyright (c) 1980, 1993
#if 0
static char sccsid[] = "@(#)move.c 8.1 (Berkeley) 5/31/93";
#else
-__RCSID("$NetBSD: move.c,v 1.9 2009/05/24 21:44:56 dholland Exp $");
+__RCSID("$NetBSD: move.c,v 1.11 2011/07/03 06:44:01 mrg Exp $");
#endif
#endif /* not lint */
#include <stdio.h>
#include <math.h>
+#include <float.h>
#include "trek.h"
/*
evtime = Now.eventptr[E_LRTB]->date - Now.date;
#ifdef xTRACE
if (Trace)
- printf("E.ep = %p, ->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
evtime += 0.005;
time = evtime;
} else
- evtime = -1.0e50;
+ evtime = DBL_MIN;
dist = time * speed;
/* move within quadrant */
n = xn + 0.5;
#ifdef xTRACE
if (Trace)
- printf("dx = %.2f, dy = %.2f, xn = %.2f, n = %d\n", dx, dy, xn, n);
+ printf("dx = %.2f, dy = %.2f, xn = %.2f, n = %d\n",
+ dx, dy, xn, n);
#endif
Move.free = 0;
iy = (y += dy);
#ifdef xTRACE
if (Trace)
- printf("ix = %d, x = %.2f, iy = %d, y = %.2f\n", ix, x, iy, y);
+ printf("ix = %d, x = %.2f, iy = %d, y = %.2f\n",
+ ix, x, iy, y);
#endif
if (x < 0.0 || y < 0.0 || x >= sectsize || y >= sectsize) {
/* enter new quadrant */
if (!damaged(COMPUTER) && ramflag <= 0) {
ix = x - dx;
iy = y - dy;
- printf("Computer reports navigation error; %s stopped at %d,%d\n",
+ printf("Computer reports navigation error; "
+ "%s stopped at %d,%d\n",
Ship.shipname, ix, iy);
Ship.energy -= Param.stopengy * speed;
break;