]> git.cameronkatri.com Git - bsdgames-darwin.git/blobdiff - battlestar/battlestar.c
Make spacing nicer and add explicit NULL initializers.
[bsdgames-darwin.git] / battlestar / battlestar.c
index 6d05adebbf9606dda4a8efd9e4550fd26a25ae21..6d0ab8ec75edddb1d87514f5e44e761d9835c33b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: battlestar.c,v 1.9 1999/09/18 16:40:04 jsm Exp $       */
+/*     $NetBSD: battlestar.c,v 1.11 2000/09/08 17:22:01 jsm Exp $      */
 
 /*
  * Copyright (c) 1983, 1993
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1993\n\
 #if 0
 static char sccsid[] = "@(#)battlestar.c       8.2 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: battlestar.c,v 1.9 1999/09/18 16:40:04 jsm Exp $");
+__RCSID("$NetBSD: battlestar.c,v 1.11 2000/09/08 17:22:01 jsm Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -68,14 +68,18 @@ main(argc, argv)
 
        /* Open the score file then revoke setgid privileges */
        open_score_file();
-       setregid(getgid(), getgid());
+       setgid(getgid());
 
-       initialize((argc < 2) ? NULL : (strcmp(argv[1], "-r") ? argv[1]
-                                       : (argv[2] ? argv[2]
-                                          : DEFAULT_SAVE_FILE)));
+       if (argc < 2)
+               initialize(NULL);
+       else if (strcmp(argv[1], "-r") == 0)
+               initialize((argc > 2) ? argv[2] : DEFAULT_SAVE_FILE);
+       else
+               initialize(argv[1]);
 start:
        news();
-       beenthere[position]++;
+       if (beenthere[position] <= ROOMDESC)
+               beenthere[position]++;
        if (notes[LAUNCHED])
                crash();        /* decrements fuel & crash */
        if (matchlight) {