[Code] Waiting on Flee

From: Brian Guilbault (guil9964@nova.gmi.edu)
Date: 01/08/97


Hi Everyone-

I was attempting to change the flee code a bit so that a player could not 
flee if they were in WAIT_STATE from performing an offensive skill. This 
is mostly so that assassins can't backstab an opponent when they are 
below their wimp level and automatically flee, only to return and do it 
again. This is the code that I came up with from fight.c. Everything is 
stock except for what's after last &&

  if (!IS_NPC(victim) && GET_WIMP_LEV(victim) && (victim != ch) &&
     GET_HIT(victim) < GET_WIMP_LEV(victim) && victim->desc->wait <
     PULSE_VIOLENCE) {

     send_to_char("You wimp out, and attempt t0 flee!\r\n", victim);
     do_flee(victim, "", 0, 0);
  }

I wrongfully assumed that this worked, but I noticed the game had been
crashing, and a gdb analysis points at this line. I tried to just do 
if(!WAIT_STATE(victim)) and if(!victim->desc>wait) but those don't work 
because if you are fighting, you are almost always in some amount of 
wait. Any ideas on how to make this work properly?

    -Brian

 -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Brian Guilbault - GMI Engineering Institute
E-mail: guil9964@gmi.edu, dante@i-55.com
WWW: http://www.gmi.edu/~guil9964/
QuarantineMUD: Telnet to exit2.i-55.com 4000
-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

+-----------------------------------------------------------+
| Ensure that you have read the CircleMUD Mailing List FAQ: |
|   http://cspo.queensu.ca/~fletcher/Circle/list_faq.html   |
+-----------------------------------------------------------+



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