Re: [CODING] Spec Proc bug...

From: Chuck Reed (master@i-55.com)
Date: 12/11/98


I added two lines.  Should fix it.

>SPECIAL(mob)
>{
>        struct char_data *vict;
>        static round;
>        static max_rounds;
>
>        vict = FIGHTING(ch);
+        if(!vict)
+          return FALSE;
>
>        if(max_rounds == 0) // if max_rounds has not been set yet
>                max_rounds = number(3,6); // set it to a random number
between 3 and 6
>
>        if ((GET_POS(ch) == POS_FIGHTING))//if the mob is fighting
>    {
>                //need to let a few rounds go by first
>                if(round < max_rounds)
>                {
>                        printf("Round - %d\n",round); //debugging code
remove when done
>                        round++;
>                        return FALSE;//return for next round
>                }
>
>                else//if random number of fights has occured
>                {
>                        //tell everyone and the player that they have been
moved
>                        send_to_char("\r\nBlah blah... dont want to give
my idea
>away!\r\n\r\n",vict);
>
>                        //stop the fight
>                        round = 0; // reset round variables for next fight
>                        max_rounds = 0; // reset max rounds variable for
next fight
>                        //stop_fighting(ch);//was removed since
char_from_room does this anyway
>                //stop_fighting(vict);//made no difference.. bug still exists
>
>
>                        //move the player to the desired room
>                    char_from_room(vict);//remove player from current room
>                        char_to_room(vict, real_room(30004));//put him in
the room
>
>                        //have player look at new room
>                        look_at_room(vict, 0);
>
>
>                }//end else
>
>
>        }//end if
>
>        else//if mob is not fighting
>        {
>                round = 0; // reset round variables for next fight
>                max_rounds = 0; // reset max rounds variable for next fight
>                act("Some special room action is done here.... :)", FALSE,
ch, 0, 0,
>TO_ROOM);
>        }//end else
>
>return FALSE;//return to regular code
>
>
>}//end SPECIAL(mob)
>
>
>     +------------------------------------------------------------+
>     | Ensure that you have read the CircleMUD Mailing List FAQ:  |
>     |  http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html  |
>     +------------------------------------------------------------+
>
>


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



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