limiting the number of attackers

From: Damian Jurzysta (interact@hem.passagen.se)
Date: 05/13/00


what I am trying to do is limit the number of attackers on a mob to 6. I did it
this way:

in set_fighting():

vict->attackers += 1;

in stop_fighting():

ch->attackers -= 1;

in do_hit():

else if (vict->attackers >= 6) {
  send_to_char("There's no room to attack!\r\n", ch);
  return;


the problem with this is that the attackers -= 1 in stop_fighting() doesnt seem
to be working properly. when fleeing, transporting etc the attackers away, the
number isnt decreased but instead seems to stack up so when attacking the mob
again, only one person can attack it. if a second person tries it says "There's
no room to attack!".

is the error due to a mistake in my added code, or do I need to try out a
totally different concept in order to add this?
--
/Damian/


     +------------------------------------------------------------+
     | 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 : 04/10/01 PDT