summaryrefslogtreecommitdiff
path: root/games/trek/help.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/help.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/help.c')
-rw-r--r--games/trek/help.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/games/trek/help.c b/games/trek/help.c
index f718070ee94..fba6b90a84b 100644
--- a/games/trek/help.c
+++ b/games/trek/help.c
@@ -1,3 +1,4 @@
+/* $OpenBSD: help.c,v 1.2 1998/08/19 07:41:39 pjanzen Exp $ */
/* $NetBSD: help.c,v 1.3 1995/04/22 10:59:01 cgd Exp $ */
/*
@@ -37,11 +38,14 @@
#if 0
static char sccsid[] = "@(#)help.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$NetBSD: help.c,v 1.3 1995/04/22 10:59:01 cgd Exp $";
+static char rcsid[] = "$OpenBSD: help.c,v 1.2 1998/08/19 07:41:39 pjanzen Exp $";
#endif
#endif /* not lint */
-# include "trek.h"
+#include <stdio.h>
+#include <math.h>
+#include <unistd.h>
+#include "trek.h"
/*
** call starbase for help
@@ -66,22 +70,33 @@ static char rcsid[] = "$NetBSD: help.c,v 1.3 1995/04/22 10:59:01 cgd Exp $";
char *Cntvect[3] =
{"first", "second", "third"};
-help()
+void
+help(v)
+ int v;
{
register int i;
double dist, x;
- register int dx, dy;
- int j, l;
+ register int dx = 0, dy = 0;
+ int j, l = 0;
/* check to see if calling for help is reasonable ... */
if (Ship.cond == DOCKED)
- return (printf("Uhura: But Captain, we're already docked\n"));
+ {
+ printf("Uhura: But Captain, we're already docked\n");
+ return;
+ }
/* or possible */
if (damaged(SSRADIO))
- return (out(SSRADIO));
+ {
+ out(SSRADIO);
+ return;
+ }
if (Now.bases <= 0)
- return (printf("Uhura: I'm not getting any response from starbase\n"));
+ {
+ printf("Uhura: I'm not getting any response from starbase\n");
+ return;
+ }
/* tut tut, there goes the score */
Game.helps += 1;
@@ -149,7 +164,7 @@ help()
Ship.sectx = dx;
Ship.secty = dy;
Sect[dx][dy] = Ship.ship;
- dock();
+ dock(0);
compkldist(0);
return;
}