Re: Seg. fault, multi-attack

From: Matthew T. Churilla (churilla@mathcs.duq.edu)
Date: 09/20/95


Ok try this for a change this is my multiattack code.  

    attacks = 1;
    if(number(1,101) <= GET_SKILL(ch, SKILL_2X))
      attacks++;
    if(number(1,101) <= GET_SKILL(ch, SKILL_3X))
      attacks++;
    while(attacks-- > 0)
      if((GET_POS(ch) == POS_FIGHTING) && (GET_POS(FIGHTING(ch)) > POS_DEAD))
	hit(ch, FIGHTING(ch), TYPE_UNDEFINED);

This code soes work on the sun that I run it on.  For some reason it seems 
that other operating systems are tollerant to referencing a pointer
to a dead mob but suns aren't.  Rember that if a mob dies in the middle of an
attack it is removed from the game and the fighting flag is removed from the 
player.

-- 

Matthew Churilla
Duquesne University CCIT User Consultant
E-Mail Addresses
-------------------------------------------------------------------------------
churilla@noether.mathcs.duq.edu	  	Math\Computer Science Account
churilla@next.duq.edu		   	CCIT Next Account
churill5624@duq3.cc.duq.edu	   	Duquesne University E-Mail Account
-------------------------------------------------------------------------------
"The difference between the right word and the almost right word is the
difference between lightning and a lightning bug."
					-Mark Twain
-------------------------------------------------------------------------------



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