Checking for Objects

From: ;P (siv@CYBERENET.NET)
Date: 05/17/98


> 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. :-)

since i haven't seen any other RTFC statements, let me make one :) but i
will also give you a clue..there isn't a macro or function included in
stock circle that will do this for you, but scanning through eq positions
and inventory is done a lot, and is easily used to write a function..

bool is_wearing(struct char_data *ch, int tobj_vnum)
{
  int i;

  for (i = 0; i < NUM_WEARS; i++)
    if (GET_OBJ_VNUM(GET_EQ(ch, i)) == tobj_vnum)
      return TRUE;

  return FALSE;
}

this will return whether or not someone is using an object of the
specified virtual number..

urm..also, could you actually put something meaningful in the subject..it
was just like  [code] [win95]..and that doesn't say anything about
what you asked (and it has nothing to do with win95)

siv


     +------------------------------------------------------------+
     | 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