Re: CODE/HELP: Second attack snipit

From: Eric Soderquist (
Date: 07/08/96

>I got the second attack/haste snippit off of the web, and I'm having a bit
>of a problem
>with it.
>First of all, I had to change the bit in fight.c to this:

You need to check to see that ch is still fighting someone.  Look below..

   if (FIGHTING(ch))                 /* <-- Add this line. */
>    if((GET_SKILL(ch, SKILL_SECOND_ATTACK) > 0)) {
>       if(GET_SKILL(ch, SKILL_SECOND_ATTACK) > number(1,200)-5*GET_LEVEL(ch) )
>         hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
>    }
>  if(IS_AFFECTED(ch,AFF_HASTE) && FIGHTING(ch)) {         /* <-- Add the
>FIGHTING(ch) here too. */
>       hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
>    }
>second of all, with this code, whenever I fight while affected by haste,
>or the
>second_attack skill, the mud crashes, with no errors in the syslog.

That way you're not passing a NULL pointer to hit().

Good luck,

Eric Soderquist -or-

IMP of BlackVortexMUD <-- currently under development

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