Don't remember changing this code so it should be 95% stock
in Gdb i see the code going back and forth to "if ( wch->reply == ch )"
in extract char when someone quit ( happen like 0.02 % of the time )
I really do suspect this loop in do_quit :) but as you it seems ok to me :)
hard to reproduce tho.
/*
* Extract a char from the world.
*/
void extract_char( CHAR_DATA *ch, bool fPull )
{
CHAR_DATA *wch;
OBJ_DATA *obj;
OBJ_DATA *obj_next;
/* doesn't seem to be necessary
if ( ch->in_room == NULL )
{
bug( "Extract_char: NULL.", 0 );
return;
}
*/
nuke_pets(ch);
ch->pet = NULL; /* just in case */
if( !IS_NPC(ch) )
nuke_mounts(ch);
if ( fPull )
die_follower( ch );
stop_fighting( ch, TRUE );
for ( obj = ch->carrying; obj != NULL; obj = obj_next )
{
obj_next = obj->next_content;
else
extract_obj( obj );
}
if (ch->in_room != NULL)
char_from_room( ch );
/* Death room is set in the clan table now */
if ( !fPull )
{ int room,born=BORN_MIDGAARD,i;
room = clan_table[ch->clan].hall;
if( room == ROOM_VNUM_ALTAR )
{
if( !IS_NPC(ch) )
born = ch->pcdata->born;
else
{
if(ch->master == NULL || IS_NPC(ch->master) )
born = BORN_MIDGAARD;
else born = ch->master->pcdata->born;
}
for(i=0; born_table[i].name != NULL
&& born_table[i].born != born ; i++ );
room = born_table[i].altar;
}
char_to_room(ch,get_room_index(room));
return;
}
if ( IS_NPC(ch) )
--ch->pIndexData->count;
if ( ch->desc != NULL && ch->desc->original != NULL )
{
do_function(ch,&do_return, "" );
ch->desc = NULL;
}
for ( wch = char_list; wch != NULL; wch = wch->next )
{
if ( wch->reply == ch )
wch->reply = NULL;
}
if ( ch == char_list )
{
char_list = ch->next;
}
else
{
CHAR_DATA *prev;
for ( prev = char_list; prev != NULL; prev = prev->next )
{
if ( prev->next == ch )
{
prev->next = ch->next;
break;
}
}
if ( prev == NULL )
{
bug( "Extract_char: char not found.", 0 );
return;
}
}
if ( ch->desc != NULL )
ch->desc->character = NULL;
free_char( ch );
return;
}
-----Original Message-----
From: Chad Simmons [mailto:[EMAIL PROTECTED]
Sent: Monday, April 08, 2002 4:29 PM
To: Despret, Jerome
Cc: [email protected]
Subject: Re: do_quit bug ?
--- "Despret, Jerome" <[EMAIL PROTECTED]> wrote:
> In do_quit i suspect this piece of code ( i eblieve it look like Rom 2.4b4 )
> to sometime run in infinite loop. In GDB you can then see the code going
> back and forth
> between extract_char and stop_fighting.
> I didn't find any other place where extract_char is called in a loop. anyone
> heard of something
> like that before ?
>
> /* toast evil cheating bastards */
> for (d = descriptor_list; d != NULL; d = d_next)
> {
> CHAR_DATA *tch;
> d_next = d->next;
> tch = d->original ? d->original : d->character;
> if (tch && tch->id == id)
> {
> extract_char(tch,TRUE); c
> close_socket(d);
> }
> }
This shouldn't be an infinite loop, unless you've somehow messed up your
descriptor list chain. What does the code for your copy of extract_char and
stop_fighting look like?
~Kender
=====
-----BEGIN GEEK CODE BLOCK-----
Version 3.1
GCS/L/C/O d-(+) s++:+ a-- C+++$>++++ UBLS++++$
P+++(--)$ L++>+++ E--- W+>++$ N !o K? w(--) !O
M- !V PS+ PE(++) Y+ PGP->+ t- 5 X+() R(+) tv+@
b++(+++) !DI+++ D G(-) e>+++$ h---() r+++ y+++
------END GEEK CODE BLOCK------
__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/