[CODE] Spec_Proc Help

From: Leonard Burns IV (lburns@CLIPPER.NET)
Date: 08/05/97

I am in the process of makinga spec_proc for mobs that will block
entrance to a certain exit if the char is not wearing the same type of
armor on WEAR_BODY. It works when the char is wearing the same armor,
but when hes not, it crashes because its trying to get a vnum from a
blank eq spot. I just can't remember the proper way to check for a vnum
of an obj, and if not eq'd return a null. Heres the part of the code,
the problematic line is marked with arrows, thanks for the help.


  for (i = 0; armor_info[i][0] != -1; i++) {
->    if ((IS_NPC(ch) || GET_OBJ_VNUM(GET_EQ(ch,WEAR_BODY)) !=  <-
         GET_OBJ_VNUM(GET_EQ(guard,WEAR_BODY))) &&
        world[ch->in_room].number == armor_info[i][0] &&
        cmd == armor_info[i][1]) {
    send_to_char(buf, ch);
    act(buf2, FALSE, ch, 0, 0, TO_ROOM);
    return TRUE;
Leonard Burns IV

     | 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/08/00 PST