Re: CODE/HELP: Second attack snipit

From: Eric Soderquist (felz@alaska.net)
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..

> hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
   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.
>Help..!
>
>SLiVER

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

Good luck,

_________________________________________________
Eric Soderquist

Esoderquist@kpbsd.k12.ak.us -or- felz@alaska.net

IMP of BlackVortexMUD <-- currently under development
_________________________________________________



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