summaryrefslogtreecommitdiff
path: root/games/trek/kill.c
diff options
context:
space:
mode:
authorPaul Janzen <pjanzen@cvs.openbsd.org>1998-08-19 07:42:28 +0000
committerPaul Janzen <pjanzen@cvs.openbsd.org>1998-08-19 07:42:28 +0000
commited884b9fa4509c09f0f7ab71efe57a4e83a2e055 (patch)
treeef9d859a0754785b42ea5cacb27aff54b5000315 /games/trek/kill.c
parentf4fc9566a4d35c0cc2bf8c7f1136287d8eec8c44 (diff)
tags, formatting, ANSI-fication, prototypes, de-typos, and the occasional
initialization, removal of unused variable, or other minor fix. Most changes are from or inspired by NetBSD.
Diffstat (limited to 'games/trek/kill.c')
-rw-r--r--games/trek/kill.c33
1 files changed, 20 insertions, 13 deletions
diff --git a/games/trek/kill.c b/games/trek/kill.c
index 9045339e9bd..9f5515d0f46 100644
--- a/games/trek/kill.c
+++ b/games/trek/kill.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: kill.c,v 1.2 1998/08/19 07:41:43 pjanzen Exp $ */
/* $NetBSD: kill.c,v 1.3 1995/04/22 10:59:06 cgd Exp $ */
/*
@@ -37,11 +38,12 @@
#if 0
static char sccsid[] = "@(#)kill.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: kill.c,v 1.3 1995/04/22 10:59:06 cgd Exp $";
+static char rcsid[] = "$OpenBSD: kill.c,v 1.2 1998/08/19 07:41:43 pjanzen Exp $";
#endif
#endif /* not lint */
-# include "trek.h"
+#include <stdio.h>
+#include "trek.h"
/*
** KILL KILL KILL !!!
@@ -59,10 +61,11 @@ static char rcsid[] = "$NetBSD: kill.c,v 1.3 1995/04/22 10:59:06 cgd Exp $";
** and the game is won if that was the last klingon.
*/
+void
killk(ix, iy)
-int ix, iy;
+ int ix, iy;
{
- register int i, j;
+ register int i;
printf(" *** Klingon at %d,%d destroyed ***\n", ix, iy);
@@ -81,7 +84,7 @@ int ix, iy;
/* purge him from the list */
Etc.nkling -= 1;
for (; i < Etc.nkling; i++)
- bmove(&Etc.klingon[i+1], &Etc.klingon[i], sizeof Etc.klingon[i]);
+ Etc.klingon[i] = Etc.klingon[i + 1];
break;
}
@@ -99,8 +102,9 @@ int ix, iy;
** handle a starbase's death
*/
+void
killb(qx, qy)
-int qx, qy;
+ int qx, qy;
{
register struct quad *q;
register struct xy *b;
@@ -110,23 +114,25 @@ int qx, qy;
if (q->bases <= 0)
return;
if (!damaged(SSRADIO))
+ {
/* then update starchart */
if (q->scanned < 1000)
q->scanned -= 10;
else
if (q->scanned > 1000)
q->scanned = -1;
+ }
q->bases = 0;
Now.bases -= 1;
for (b = Now.base; ; b++)
if (qx == b->x && qy == b->y)
break;
- bmove(&Now.base[Now.bases], b, sizeof *b);
+ *b = Now.base[Now.bases];
if (qx == Ship.quadx && qy == Ship.quady)
{
Sect[Etc.starbase.x][Etc.starbase.y] = EMPTY;
if (Ship.cond == DOCKED)
- undock();
+ undock(0);
printf("Starbase at %d,%d destroyed\n", Etc.starbase.x, Etc.starbase.y);
}
else
@@ -146,14 +152,14 @@ int qx, qy;
** kill an inhabited starsystem
**/
+void
kills(x, y, f)
-int x, y; /* quad coords if f == 0, else sector coords */
-int f; /* f != 0 -- this quad; f < 0 -- Enterprise's fault */
+ int x, y; /* quad coords if f == 0, else sector coords */
+ int f; /* f != 0 -- this quad; f < 0 -- Enterprise's fault */
{
register struct quad *q;
register struct event *e;
register char *name;
- char *systemname();
if (f)
{
@@ -190,9 +196,10 @@ int f; /* f != 0 -- this quad; f < 0 -- Enterprise's fault */
** "kill" a distress call
**/
+void
killd(x, y, f)
-int x, y; /* quadrant coordinates */
-int f; /* set if user is to be informed */
+ int x, y; /* quadrant coordinates */
+ int f; /* set if user is to be informed */
{
register struct event *e;
register int i;