Need help with this

From: Ace (ace@b63740.student.cwru.edu)
Date: 07/31/95


I added two new skills, second and third attack, and everything works 
fine except that I get a segmentation fault at this line in fight.c :
(from void hit )

  if (ch->in_room != victim->in_room) {    <-- this is the line where it dies
    if (FIGHTING(ch) && FIGHTING(ch) == victim)
      stop_fighting(ch);
    return;
  }

I added some really basic (and probably not very sound) code for second 
and third attacks, but those work OK.  Is this a bug that was fixed 
earlier that I don't know about, or is there something wrong with this code:

(this is in perform_violenceA)

    if ((GET_POS(ch) == POS_FIGHTING) && (GET_LEVEL(ch) >= 15)) {
	if (IS_NPC(ch)) {
		mob_prob = (35 + GET_LEVEL(ch));
	}
	if ((GET_SKILL(ch, SKILL_SECOND) > 0) || (mob_prob >= 35)) {
		percent = number(1, 101);
		prob = GET_SKILL(ch, SKILL_SECOND);
		if ((prob >= percent) || (mob_prob >= percent)) {
			hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
		}
	}
	if (GET_LEVEL(ch) >= 30) {
        	if ((GET_SKILL(ch, SKILL_THIRD) > 0) || (mob_prob >= 35)) {
			percent = number(1, 101);
			prob = GET_SKILL(ch, SKILL_THIRD);
			if ((prob >= percent) || (mob_prob >= percent)) {
				hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
			}
		}
	}
    }


Really generic code, I know, but it works (well, sort of - it worked fine 
in 2.11)

Any suggestions, or better second/third attack code?

Ace
__
Ace   		       	   ace@b63740.cwru.edu   srk4@po.cwru.edu
Metal Director             WWW->http://b63740.cwru.edu/brothers/ace/ace.html
WRUW-FM / Cleveland        AbsolutMUD (b63740.cwru.edu 4000)

Who are you to criticize           |
To judge and burn the tribes       | Put your money where your mouth is
The world will be extinct	   | So I can shove it down your throat.
And your flesh will rot with mine. |



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