Subject: bin/6048: [PATCH] Battlestar bug fix 5
To: None <gnats-bugs@gnats.netbsd.org>
From: Joseph Myers <jsm@octomino.demon.co.uk>
List: netbsd-bugs
Date: 08/26/1998 15:57:34
>Number:         6048
>Category:       bin
>Synopsis:       [PATCH] Battlestar bug fix 5
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Aug 26 10:05:00 1998
>Last-Modified:
>Originator:     Joseph Samuel Myers
>Organization:
Trinity College, University of Cambridge, UK
>Release:        NetBSD-current of 1998-08-24
>Environment:
[
System: Linux octomino 2.0.35 #1 Wed Aug 12 15:54:21 UTC 1998 i586 unknown
Architecture: i586
]
>Description:

In the game battlestar, certain objects have special handling when
taken (see the function take()).  This depends on the word type of the
word used for the object being NOUNS: the following patch fixes this
to work when `take all' is used, which it would not otherwise.  The
comment added in the patch explains why the cases included are right.

>How-To-Repeat:

>Fix:

diff -ruN battlestar/cypher.c battlestar+2/cypher.c
--- battlestar/cypher.c	Mon Aug 24 11:05:31 1998
+++ battlestar+2/cypher.c	Wed Aug 26 11:54:57 1998
@@ -118,6 +118,36 @@
 				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++;
>Audit-Trail:
>Unformatted: