Re: Auto DHIT

From: Johan Dustler (epkjodu@hmepks1.ericsson.se)
Date: 06/04/96


> From: Tarot <tarot@erinet.com>
> 
> Ok, call me a moron, but does anyone know why this code (from the end of
> fight.c) causes the mud to crash?
> 
> /* Auto DHIT */
>     if (GET_LEVEL(ch) >= 15 && GET_CLASS(ch) == CLASS_WARRIOR && !IS_NPC(ch)) 

Add '&& FIGHTING(ch)' in the iff statement

>       hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
> /* end of Auto DHIT */

Add:
     if (FIGHTING(ch))

>     hit(ch, FIGHTING(ch), TYPE_UNDEFINED);    
>     if (MOB_FLAGGED(ch, MOB_SPEC) && mob_index[GET_MOB_RNUM(ch)].func !=
> NULL)         (mob_index[GET_MOB_RNUM(ch)].func) (ch, ch, 0, "");
> 
> I think I might have missed something earlyer in the code, but not quite
> sure.  I player hits and then Dhits then the prompt appears and the mud crashes.
> 
> HELP,
> Doyle

You need the FIGHTING(ch) to check if the mob/pc that ch is fighting is still
alive or not.

-Johan



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