-/* $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
#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 */
/* 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) {