From ed51e2ee8c47dbb4c8041637e215fab3dac5bc06 Mon Sep 17 00:00:00 2001 From: jsm Date: Sat, 23 Sep 2000 19:23:57 +0000 Subject: 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". --- battlestar/extern.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'battlestar/extern.h') 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 -- cgit v1.2.3