diff options
-rw-r--r-- | battlestar/battlestar.c | 16 | ||||
-rw-r--r-- | battlestar/extern.h | 5 | ||||
-rw-r--r-- | battlestar/room.c | 6 |
3 files changed, 17 insertions, 10 deletions
diff --git a/battlestar/battlestar.c b/battlestar/battlestar.c index e3c0d4cc..6d0ab8ec 100644 --- a/battlestar/battlestar.c +++ b/battlestar/battlestar.c @@ -1,4 +1,4 @@ -/* $NetBSD: battlestar.c,v 1.10 2000/05/08 07:56:01 mycroft 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.10 2000/05/08 07:56:01 mycroft Exp $"); +__RCSID("$NetBSD: battlestar.c,v 1.11 2000/09/08 17:22:01 jsm Exp $"); #endif #endif /* not lint */ @@ -70,12 +70,16 @@ main(argc, argv) open_score_file(); 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) { diff --git a/battlestar/extern.h b/battlestar/extern.h index 7ffec2c9..3e28683f 100644 --- a/battlestar/extern.h +++ b/battlestar/extern.h @@ -1,4 +1,4 @@ -/* $NetBSD: extern.h,v 1.16 2000/07/23 23:57:23 mycroft Exp $ */ +/* $NetBSD: extern.h,v 1.17 2000/09/08 17:22:02 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -206,6 +206,9 @@ #define DUG 5 #define NUMOFNOTES 6 +/* Number of times room description shown. */ +#define ROOMDESC 3 + /* fundamental constants */ #define NUMOFROOMS 275 #define NUMOFWORDS ((NUMOFOBJECTS + BITS - 1) / BITS) diff --git a/battlestar/room.c b/battlestar/room.c index 8cdabae7..ddcd1fa4 100644 --- a/battlestar/room.c +++ b/battlestar/room.c @@ -1,4 +1,4 @@ -/* $NetBSD: room.c,v 1.7 1999/02/10 01:36:50 hubertf Exp $ */ +/* $NetBSD: room.c,v 1.8 2000/09/08 17:22:02 jsm Exp $ */ /* * Copyright (c) 1983, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)room.c 8.2 (Berkeley) 4/28/95"; #else -__RCSID("$NetBSD: room.c,v 1.7 1999/02/10 01:36:50 hubertf Exp $"); +__RCSID("$NetBSD: room.c,v 1.8 2000/09/08 17:22:02 jsm Exp $"); #endif #endif /* not lint */ @@ -52,7 +52,7 @@ writedes() int c; printf("\n\t%s\n", location[position].name); - if (beenthere[position] < 3) { + if (beenthere[position] < ROOMDESC) { compass = NORTH; for (p = location[position].desc; (c = *p++) != 0;) if (c != '-' && c != '*' && c != '+') |