Defend skill again

From: Shane Augustine (sca@bu.edu)
Date: 02/13/99


Ok i wrote about the defend skill and i appreciate the help and changed
it to protect
to.  Now it works fine when PROTECTING(ch) starts a fight, however when
the
mob attacks, and the PROTECTED_BY(ch) saves, the PROTECTED_BY(ch) is
able to get in 2 attacks before the mob has a chance to retaliate.  This
is the code:

 if(PROTECTED_BY(ch)) {
  if(ch->in_room == PROTECTED_BY(ch)->in_room) {
   temp_ch = FIGHTING(ch);
   stop_fighting(FIGHTING(ch));
   stop_fighting(temp_ch);
            //act("$n rushes into battle and protects you!", TRUE, 0, 0,
PROTECTED_BY(ch), TO_CHAR);
   //send_to_char("Can you see this?", ch);
            set_fighting(temp_ch, PROTECTED_BY(ch));
   set_fighting(PROTECTED_BY(ch), temp_ch);    // I tried reversing
these two lines but that didn't work
   //set_fighting(temp_ch, PROTECTED_BY(ch)); // either
   unprotect_char(ch);
   continue;
  }
 }

Any idea what to do to prevent this?
Setting the mob to attack first doesn't work either.  Nor does putting a
waitstate because
it would only affect their active actions.


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