summaryrefslogtreecommitdiffstats
path: root/battlestar/battlestar.c
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>2000-09-08 17:22:01 +0000
committerjsm <jsm@NetBSD.org>2000-09-08 17:22:01 +0000
commite78113b43d320fbf5b1a2323cb902663188952d0 (patch)
treeeb7044ea6a1803cfea9d3ba779dbeae434c9cba3 /battlestar/battlestar.c
parentbed19f972cb4bcc628ec73e35c8e9f9e6b8c6341 (diff)
downloadbsdgames-darwin-e78113b43d320fbf5b1a2323cb902663188952d0.tar.gz
bsdgames-darwin-e78113b43d320fbf5b1a2323cb902663188952d0.tar.zst
bsdgames-darwin-e78113b43d320fbf5b1a2323cb902663188952d0.zip
Make code clearer; add a macro ROOMDESC for the number of times a room
should be visited for the short description only to be used, and don't increment beenthere[position] beyond this value. From OpenBSD.
Diffstat (limited to 'battlestar/battlestar.c')
-rw-r--r--battlestar/battlestar.c16
1 files changed, 10 insertions, 6 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) {