X-Git-Url: https://git.cameronkatri.com/bsdgames-darwin.git/blobdiff_plain/462fca95471224f85b85be911e72faee16cd1597..dd096191dcfacdcbd63dabb28e4aeb1c79cfafae:/trek/move.c diff --git a/trek/move.c b/trek/move.c index eea64ccc..d1941b53 100644 --- a/trek/move.c +++ b/trek/move.c @@ -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 @@ -10,11 +12,7 @@ * 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. * @@ -31,12 +29,18 @@ * SUCH DAMAGE. */ +#include #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 +#include +#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;