Re: Multiple Attacks in fight.c

From: Neal Lahndorff (stulahnd@ACS.EKU.EDU)
Date: 03/19/98


On Thu, 19 Mar 1998, Paul Siegel wrote:

> Hello again.  Anyone sick of me yet?  Here's an interesting poser for anyone that cares.  I've been editing my circlemud code to switch from its obvious AD&D rules base into a system based on Warhammer Quest (anyone ever play it?).  Well, in WHQ many characters/monsters have multiple attacks per round, so I added an attribute called attacks, and in fight.c I switched the line in the perform_violence procedure from:
>         hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
> to:
>         for (int i = 0; i < GET_ATTACKS(ch); i++) {
>                 hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
>         }
> Well, this seemed all hunky-dorey until I noticed an odd occurance.  I was testing by loading two mobs, then forcing one to attack the other.  Should it occur that a mob with multiple attacks brings another mob below 0 hitpoints but not kill him (ie, POS_DEAD < mob's pos < POS_STANDING) the server crashes and I got the following line in my syslog:
>
>   SYSERR: the Orc Warrior (#108): Attempting to call non-existing mob func
>
> Note that the Orc Warrior (#108) was the mob that had only one attack and was the one that was dying when the system crashed.  I also edited the mob file so both mobs had only one attack and could not reproduce the error.
>
> Does anyone know this syserr better than I who could shed some light on the subject?  I appreciate it.
>
hmm not sure why that syserr is popping up, but my guess as to why its
crashing is that you're, well, beating a dead horse.  For example, mob a
gets 5 attacks, but he kills his opponent on the first hit, the next four
attacks go against no one, because the mob is removed when its killed, so
a simple check to make sure the victim isn't already dead before you
attack should help.

Neal


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



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