Re: [STOCK-BUG] act.items.c

From: Daniel Koepke (dkoepke@CALIFORNIA.COM)
Date: 05/28/98

On Wed, 28 May 1998, Pheonix Shadowflame wrote:

->While adding a few eq positions as I saw the "!RESERVED!" keywords for
->eq I logged on to my mud and typed wear bread !.

After checking in stock bpl 12 I have determined that this bug is
indeed present, but easily solvable (and mostly harmless).  The
problem is with the wear_bitvectors[] array in perform_wear().

  int wear_bitvectors[] = {

Note that just above this it is mentioned that ITEM_WEAR_TAKE is used
for objects that don't require any special bits to be put into that
particular position -- so the problem should have been obvious from
looking at the code.  Hmm, but everyone missed it, so...

Anyway, the solution, and a bit of hack it is, is to make sure that
you don't light anything that's not a light.

  if (!CAN_WEAR(obj, wear_bitvectors[where])) {

Should be changed to,

  if (!CAN_WEAR(obj, wear_bitvectors[where]) ||
      (where == WEAR_LIGHT && GET_OBJ_TYPE(obj) != ITEM_LIGHT)) {

This is rather cheap, but it doesn't require any more ITEM_WEAR_
flags to be added, and is functional.  Alternatively, you can hack
find_eq_pos() to make sure it doesn't find the reserved entries,

  if ((where = search_block(arg, keywords, FALSE)) < 0) {
  } else (!str_cmp(keywords[where], "!RESERVED!"))
    where = -1;


     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
     | |

This archive was generated by hypermail 2b30 : 12/15/00 PST