summaryrefslogtreecommitdiffstats
path: root/battlestar/cypher.c
diff options
context:
space:
mode:
authorhubertf <hubertf@NetBSD.org>1999-03-25 16:46:08 +0000
committerhubertf <hubertf@NetBSD.org>1999-03-25 16:46:08 +0000
commit2dc171dacaf07b67792019a44cca6d11b1c783a4 (patch)
treefd206832dcb767db07ea167e6770eb9b78a310b4 /battlestar/cypher.c
parent7e7b15a3a1ec5946c797bfa36a4841de06fdcd0c (diff)
downloadbsdgames-darwin-2dc171dacaf07b67792019a44cca6d11b1c783a4.tar.gz
bsdgames-darwin-2dc171dacaf07b67792019a44cca6d11b1c783a4.tar.zst
bsdgames-darwin-2dc171dacaf07b67792019a44cca6d11b1c783a4.zip
Fix object recognition, per PR 6048 by Joseph S. Myers <jsm28@cam.ac.uk>.
Diffstat (limited to 'battlestar/cypher.c')
-rw-r--r--battlestar/cypher.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/battlestar/cypher.c b/battlestar/cypher.c
index d3d85904..7e0e1ba2 100644
--- a/battlestar/cypher.c
+++ b/battlestar/cypher.c
@@ -1,4 +1,4 @@
-/* $NetBSD: cypher.c,v 1.7 1998/08/24 00:25:32 hubertf Exp $ */
+/* $NetBSD: cypher.c,v 1.8 1999/03/25 16:46:08 hubertf Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cypher.c 8.2 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: cypher.c,v 1.7 1998/08/24 00:25:32 hubertf Exp $");
+__RCSID("$NetBSD: cypher.c,v 1.8 1999/03/25 16:46:08 hubertf Exp $");
#endif
#endif /* not lint */
@@ -118,6 +118,36 @@ cypher()
for (n = 0; n < NUMOFOBJECTS; n++)
if (testbit(location[position].objects, n) && objsht[n]) {
wordvalue[wordnumber + 1] = n;
+ /* Some objects (type NOUNS)
+ * have special treatment in
+ * take(). For these we
+ * must set the type to NOUNS.
+ * However for SWORD and BODY
+ * all it does is find which
+ * of many objects is meant,
+ * so we need do nothing here.
+ * BATHGOD must become
+ * NORMGOD as well. NOUNS
+ * with no special case
+ * must be included here to
+ * get the right error. DOOR
+ * cannot occur as an object
+ * so need not be included. */
+ switch(n) {
+ case BATHGOD:
+ wordvalue[wordnumber + 1] = NORMGOD;
+ case NORMGOD:
+ case AMULET:
+ case MEDALION:
+ case TALISMAN:
+ case MAN:
+ case TIMER:
+ case NATIVE:
+ wordtype[wordnumber + 1] = NOUNS;
+ break;
+ default:
+ wordtype[wordnumber + 1] = OBJECT;
+ }
wordnumber = take(location[position].objects);
}
wordnumber++;