From e78113b43d320fbf5b1a2323cb902663188952d0 Mon Sep 17 00:00:00 2001 From: jsm Date: Fri, 8 Sep 2000 17:22:01 +0000 Subject: 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. --- battlestar/battlestar.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'battlestar/battlestar.c') 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) { -- cgit v1.2.3-56-ge451