[Newbie][LONG] New EQ positions

From: J. David Ribak (ribak@Token.Net)
Date: 10/02/96


I am having a little trouble adding new eq positions to my mud.
Here is some background: Circle 3.0 bpl11, with the auto-eq
patch from the ftp site.  Here are the relevant sections of
code:

Structs.h:
#define WEAR_WIELD     16
#define WEAR_HOLD      17
#define WEAR_EAR_L     18       /* New EQ positions--Aleks */
#define WEAR_EAR_R     19       /* New EQ positions--Aleks */
#define WEAR_FACE      20       /* New EQ positions--Aleks */
#define NUM_WEARS      21       /* This must be the # of eq positions!! */ 

#define ITEM_WEAR_WIELD         (1 << 13) /* Can be wielded             */
#define ITEM_WEAR_HOLD          (1 << 14) /* Can be held                */
#define ITEM_THROW              (1 << 15) /* PLACE HOLDER               */
#define ITEM_LIGHT_SOURCE       (1 << 16) /* PLACE HOLDER               */
#define ITEM_WEAR_EAR           (1 << 17) /* New EQ positions--Aleks    */
#define ITEM_WEAR_FACE          (1 << 18) /* New EQ positions--Aleks    */

(The Place Holders are there because I have a pre-existing world, and I didnt want
to change the wear bitvectors on all the face and ear items)

Constants.c:
  "<worn around wrist>  ",
  "<wielded>            ",
  "<held>               ",
  "<worn on ear>        ",      /* New EQ positions--Aleks */
  "<worn on ear>        ",      /* New EQ positions--Aleks */
  "<worn on face>       "       /* New EQ positions--Aleks */
};

  "Worn around left wrist",
  "Wielded",
  "Held",
  "Worn on left ear",           /* New EQ positions--Aleks */
  "Worn on right ear",          /* New EQ positions--Aleks */
  "Worn on face",               /* New EQ positions--Aleks */
  "\n"
};

  "WRIST",
  "WIELD",
  "HOLD",
  "EAR",                /* New EQ positions--Aleks */
  "FACE",               /* New EQ positions--Aleks */
  "\n"
};

Act.item.c:
   {"$n grabs $p.", 
    "You grab $p."},

    {"$n clips $p on $s left ear.",     /* New EQ positions--Aleks */
    "You clip $p on your left ear."},

    {"$n clips $p on $s right ear.",    /* New EQ positions--Aleks */
    "You clip $p on your right ear."},

    {"$n puts $p on $s face.",          /* New EQ positions--Aleks */
    "You put $p on your face."}

  };

  int wear_bitvectors[] = {
    ITEM_WEAR_TAKE, ITEM_WEAR_FINGER, ITEM_WEAR_FINGER, ITEM_WEAR_NECK,
    ITEM_WEAR_NECK, ITEM_WEAR_BODY, ITEM_WEAR_HEAD, ITEM_WEAR_LEGS,
    ITEM_WEAR_FEET, ITEM_WEAR_HANDS, ITEM_WEAR_ARMS, ITEM_WEAR_SHIELD,
    ITEM_WEAR_ABOUT, ITEM_WEAR_WAIST, ITEM_WEAR_WRIST, ITEM_WEAR_WRIST,
  ITEM_WEAR_WIELD, ITEM_WEAR_TAKE, ITEM_WEAR_EAR, ITEM_WEAR_EAR, ITEM_WEAR_FACE};

    "You're already wielding a weapon.\r\n",
    "You're already holding something.\r\n",
    /* New EQ positions--Aleks */
    "You're already wearing something on your ear.\r\n",
    "You're already wearing something on your face.\r\n"
  };

  /* for neck, finger, and wrist, try pos 2 if pos 1 is already full */
  /* Added ear--New EQ positions--Aleks */
  if ((where == WEAR_FINGER_R) || (where == WEAR_EAR_L) || (where == WEAR_NECK_1) || (where
 == WEAR_WRIST_R))

    "wrist",
    "!RESERVED!",
    "!RESERVED!",
    "!RESERVED!",
    "ear",              /* New EQ positions--Aleks */
    "!RESERVED!",       /* New EQ positions--Aleks */
    "face",             /* New EQ positions--Aleks */
    "\n"
  };

    if (CAN_WEAR(obj, ITEM_WEAR_WRIST))       where = WEAR_WRIST_R;
        /* New EQ positions--Aleks */
    if (CAN_WEAR(obj, ITEM_WEAR_EAR))         where = WEAR_EAR_L;
    if (CAN_WEAR(obj, ITEM_WEAR_FACE))        where = WEAR_FACE;
  } else {

objsave.c:
      break;
    case WEAR_HOLD:
      if (!CAN_WEAR(obj,ITEM_WEAR_HOLD) &&
          !(IS_WARRIOR(ch) &&
            CAN_WEAR(obj,ITEM_WEAR_WIELD) && GET_OBJ_TYPE(obj) == ITEM_WEAPON))
        locate = 0;
      break;
/* New EQ positions--Aleks */
    case WEAR_EAR_L:
    case WEAR_EAR_R:
      if (!CAN_WEAR(obj,ITEM_WEAR_EAR))
        locate = 0;
      break;
    case WEAR_FACE:
      if (!CAN_WEAR(obj, ITEM_WEAR_FACE))
        locate = 0;
      break;
    default:

I hope you can make sense of my cutting and pasting..if not, I will edit
it and resned it with appropriate cut marks...


Here is the problem:
You can wear two earrings and one mask without a problem.
When you try to wear a third earring, it tells you you are already
wearing something on yoru face.
When you try to wear another mask, it seg faults.

Does anyone know where I am going wrong?

Thanks
Aleks
ribak@token.net

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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