Seg. fault, multi-attack

From: Rasmus R\xnlev (raro94ab@hp4.cbs.dk)
Date: 09/20/95


Hi again,
 
After trying some different things, for one useing gdb to trace where my 
circle code crashes I'm eft in an empty space... 8)

It seems as if my fight.c code is the 'nasty bugged' code.
I implemented multiple attacks, and to make thge situation clearer I've 
decided to post my (very short) way of implementing it ... (wich I by the 
way beleave is the thing that causes the bug).

in the perform_violence() routine I've added the following:
 
[The original code - CUT:]

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, "");

[UNCUT], this is what I've added... 

[MYADD-START]

if(GET_SKILL(ch, SKILL_SECOND_ATTACK))
    hit(ch, FIGHTING(ch), TYPE_UNDEFINED);
if(GET_SKILL(ch, SKILL_THIRD_ATTACK))
    hit(ch, FIGHTING(ch), TYPE_UNDEFINED); 

[MYADD-END]

Now, when I run this on my own Linux mashine (with and without gdb) the 
mud seems to run perfectly... 

Now when i transter the source (and only the soure, not pfiles! 8) I 
allso compile the source without errors on teh SunOS.. 

Now, if I start a fight on the SunOS mashine I get some combat messages, 
and then the mud crashes... 

when using gdb it said it crashed in line 765 of the fight.c code... 
this is in the hit() procedure... 

[CUT]

 (line 765:)    if (ch->in_room != victim->in_room) {
                  if (FIGHTING(ch) && FIGHTING(ch) == victim)
                     stop_fighting(ch);
                     return;

[UNCUT]

This is as far as I could trace the bug... it seems as if the problem 
arises when the ch->in_room  ot victim->in_room is evaluated... but on 
the other hand, if this is the case it should crash on both mashines... 

I'd be happy to send more info, or whatever... 
Might allso be, that I need some new glasses because i've missed the 
obvious reason...

Anyways, hope I didnt mess up your lives, or burned down a mailserver to 
get anought bandwith to get this message thru to you 8)

Regards,
Rasmus R./Con.



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