summaryrefslogtreecommitdiffstats
path: root/battlestar/extern.h
diff options
context:
space:
mode:
authorjsm <jsm@NetBSD.org>2000-09-23 19:23:57 +0000
committerjsm <jsm@NetBSD.org>2000-09-23 19:23:57 +0000
commited51e2ee8c47dbb4c8041637e215fab3dac5bc06 (patch)
treef0754b91491885c992dfec97463662771c64eb3e /battlestar/extern.h
parentd89b56558a1f45934500212b523bd084ad39752c (diff)
downloadbsdgames-darwin-ed51e2ee8c47dbb4c8041637e215fab3dac5bc06.tar.gz
bsdgames-darwin-ed51e2ee8c47dbb4c8041637e215fab3dac5bc06.tar.zst
bsdgames-darwin-ed51e2ee8c47dbb4c8041637e215fab3dac5bc06.zip
Use a lookup table to identify whether objects are plural or singular,
instead of testing the final character against 's' in each place. Avoids oddities about "pot of jewels" and "compass".
Diffstat (limited to 'battlestar/extern.h')
-rw-r--r--battlestar/extern.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/battlestar/extern.h b/battlestar/extern.h
index 81ffa9c3..3257bfd7 100644
--- a/battlestar/extern.h
+++ b/battlestar/extern.h
@@ -1,4 +1,4 @@
-/* $NetBSD: extern.h,v 1.21 2000/09/21 17:44:34 jsm Exp $ */
+/* $NetBSD: extern.h,v 1.22 2000/09/23 19:23:58 jsm Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -227,6 +227,9 @@
#define MAXWEIGHT 60
#define MAXCUMBER 10
+/* Flags for objects. */
+#define OBJ_PLURAL 1
+
struct room {
const char *name;
int link[8];
@@ -251,6 +254,8 @@ extern const char *const objsht[NUMOFOBJECTS];
extern const char *const ouch[NUMOFINJURIES];
extern const int objwt[NUMOFOBJECTS];
extern const int objcumber[NUMOFOBJECTS];
+extern const int objflags[NUMOFOBJECTS];
+#define is_plural_object(n) (objflags[(n)] & OBJ_PLURAL)
/* current input line */
#define WORDLEN 15