Re: [CODE] [MSVC5, Win95]

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


On Sun, 17 May 1998, JWoodsIII wrote:

->Anyone out there know of a way to check to see if a player is
->wearing or holding a particular object? I looked for things like
->IS_WEARING or GET_WEARING, but couldn't find them. Any ideas? It's
->for a spec_proc in a game I'm a builder in. :-)

Dare I say it?  I do.  RTFC.  Really, it would make a lot of sense to
look at do_equipment to see the macro EQ in use.  Let's see if 'ch' is
holding 'obj',

  if (EQ(ch, WEAR_HOLD) == obj) {
    send_to_char("You are holding the obect.\r\n", ch);
    return TRUE;
  }

Or, even,

  struct obj_data * obj = EQ(ch, WEAR_HOLD);
  obj_vnum my_obj_vnum = 666;

  if (!obj || GET_OBJ_VNUM(obj) != my_obj_vnum) {
    send_to_char("Nope, they aren't holding object 666.\r\n", ch);
    return TRUE;
  }

Or something ... Just RTFC.

-dak : "This guy is smart, very smart!  He has an IQ." - ?


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



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