]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - trek/help.c
use symbolic constant for open(), PR#5867
[bsdgames-darwin.git] / trek / help.c
index 091210b0421bff5a8dd04767e5972d645b221bfa..bedafcfd8de3cefb4967848f43c7681930f01adf 100644 (file)
@@ -1,6 +1,8 @@
+/*     $NetBSD: help.c,v 1.4 1997/10/12 21:24:53 christos 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
  * SUCH DAMAGE.
  */
 
+#include <sys/cdefs.h>
 #ifndef lint
-static char sccsid[] = "@(#)help.c     5.4 (Berkeley) 6/1/90";
+#if 0
+static char sccsid[] = "@(#)help.c     8.1 (Berkeley) 5/31/93";
+#else
+__RCSID("$NetBSD: help.c,v 1.4 1997/10/12 21:24:53 christos Exp $");
+#endif
 #endif /* not lint */
 
-# include      "trek.h"
+#include <stdio.h>
+#include <math.h>
+#include <unistd.h>
+#include "trek.h"
 
 /*
 **  call starbase for help
@@ -60,22 +70,31 @@ static char sccsid[] = "@(#)help.c  5.4 (Berkeley) 6/1/90";
 char   *Cntvect[3] =
 {"first", "second", "third"};
 
-help()
+/*ARGSUSED*/
+void
+help(v)
+       int v;
 {
-       register int            i;
-       double                  dist, x;
-       register int            dx, dy;
-       int                     j, l;
+       int             i;
+       double          dist, x;
+       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"));
+       if (Ship.cond == DOCKED) {
+               printf("Uhura: But Captain, we're already docked\n");
+               return;
+       }
 
        /* or possible */
-       if (damaged(SSRADIO))
-               return (out(SSRADIO));
-       if (Now.bases <= 0)
-               return (printf("Uhura: I'm not getting any response from starbase\n"));
+       if (damaged(SSRADIO)) {
+               out(SSRADIO);
+               return;
+       }
+       if (Now.bases <= 0) {
+               printf("Uhura: I'm not getting any response from starbase\n");
+               return;
+       }
 
        /* tut tut, there goes the score */
        Game.helps += 1;
@@ -143,7 +162,7 @@ help()
                                Ship.sectx = dx;
                                Ship.secty = dy;
                                Sect[dx][dy] = Ship.ship;
-                               dock();
+                               dock(0);
                                compkldist(0);
                                return;
                        }