diff options
author | jsm <jsm@NetBSD.org> | 2000-09-23 19:23:57 +0000 |
---|---|---|
committer | jsm <jsm@NetBSD.org> | 2000-09-23 19:23:57 +0000 |
commit | ed51e2ee8c47dbb4c8041637e215fab3dac5bc06 (patch) | |
tree | f0754b91491885c992dfec97463662771c64eb3e /battlestar/extern.h | |
parent | d89b56558a1f45934500212b523bd084ad39752c (diff) | |
download | bsdgames-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.h | 7 |
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 |