Re: [CODE] Spec_Proc Help

From: Patrick J. Dughi (dughi@IMAXX.NET)
Date: 08/05/97


>
>
> SPECIAL(armor_guard)
> {
> [**SNIP**]
>
>   for (i = 0; armor_info[i][0] != -1; i++) {

/*Add this line below */
        if (GET_EQ(ch,WEAR_BODY))

> ->    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;
>     }
>   }

        Just like you said - the armor isn't there - check if it is, and
if it isn't, don't compare the result of an operation on a null value to
something.... just skip that part.

                                                PjD


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