[CODING] Spec Proc bug...

From: CyberLord (tmillea@nfinity.com)
Date: 12/11/98

I wrote a spec proc that after a few rounds fighting this mob you are put in
another room.

I found a bug that is kind of irritating me since I can't find where it is
going haywire.

A player starts the fight... and after the randon number of rounds the
player is moved to
 another room.. that all works fine..

If a god is fighting the mob and does a goto <mob> seemingly at the same
time the spec
 proc does it's char_from_room and char_to _room calls the mob gets moved
into the
room along with the god.

Now I've gone over my code and can't logically figure it out.  It could be
that the
char_from_room and the char_to_room somehow act on both the mob and the
but I can't find where this could be happening in the code.

Any help appreciated. :)

Snippet follows:

        struct char_data *vict;
        static round;
        static max_rounds;

        vict = FIGHTING(ch);

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

                        //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,
        }//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  |

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