I agree with Richard. In the nanny, you should be checking against the descriptor_list and looking at 'd->character' for your data instead of the 'player_list'. This will also take less time since it will never pick up NPC's from the descriptor_list.
- Valnir ----- Original Message ----- From: "Richard Lindsey" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]>; <[email protected]> Sent: Tuesday, July 27, 2004 9:24 AM Subject: RE: tier/remort I'm with potatohead on this one, but just to verify where the actual problem is, how about you break it in gdb again and print wch and wch->next_player and post that output to the list as well, that way we can see if wch = 0x0 or if it's something like 0x24 or whatever... and you could also try looping through the descriptor_list instead and only checking for players who's d->connected == CON_PLAYING... that way if a person were to drop link in the middle of a battle and autoflee into a room w/ an agro mob, they wouldn't get pummeled, and if their connected == CON_BEGIN_ASCEND, or anything in creation, it would skip over them... wavewave Richard Lindsey. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 27, 2004 9:18 AM To: [email protected] Subject: Re: tier/remort That shouldn't change anything. If it was blowing up assigning wch->next_player to wch_next, then it should blow up assigning it to a different variable. The for statement appears valid: >> for (wch = player_list; wch != NULL; wch = wch_next) >> > > { >> > > wch_next = wch->next_player; <=== bombs her The only way it could blow up on this line is if wch itself was null, or if wch->next_player was pointing to memory it shouldn't be. The former can be ruled out by the condition of the for loop. The latter, on the other hand, is not checked until the next iteration of the loop, and is also the likely candidate based on what Rick has told us he's working on. It sounds like the problem is the way you are removing the character from the list. If you post that piece of code to the list maybe we can help you out. Just as an idea, the way our remort code works is by calling extract_char(), then unlinking the file, then calling load_char_obj(). Basically that results in a cleaned out CHAR_DATA structure that we restore the stats we want to retain into before pushing the character into a remort step of creation. > The player not being valid is probably right. > > instead of using "wch->next_player" in the for statement, add "CHAR_DATA > *next_player;" at the top of your function. Put "wch = next_player" > instead > of "wch = wch->next_player" in the for statement, and add "next_player = > wch->next_player;" as the first line inside the for { }. > > - Valnir > > ----- Original Message ----- > From: "Krayzie K" <[EMAIL PROTECTED]> > To: <[email protected]> > Sent: Tuesday, July 27, 2004 1:15 AM > Subject: RE: tier/remort > > >> I am thinking that wch->next_player; is not valid any more as the > character >> has been taken out of the player_list when put into the remort process. >> >> I have had this problem before, actually when trying to re-do my remort >> system as well. >> >> -----Original Message----- >> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rick St > Jean >> Sent: Monday, July 26, 2004 10:53 PM >> To: [email protected] >> Subject: Re: tier/remort >> >> Undefined command: "qt". Try "help". >> (gdb) bt >> #0 aggr_update () at update.c:2151 >> #1 0x080c030f in update_handler () at update.c:2517 >> #2 0x0807a1f5 in game_loop_unix (control=6) at comm.c:1485 >> #3 0x08079876 in main (argc=2, argv=0xbffff964) at comm.c:916 >> #4 0x40086c57 in ?? () >> >> >> line 2151 is wch_next = wch->next_player; >> >> At 11:45 PM 7/26/2004, you wrote: >> >You say it's crashing on an update? Why does GDB say that it's crashing >> >over? >> > >> > >> >----- Original Message ----- >> >From: "Rick St Jean" <[EMAIL PROTECTED]> >> >To: <[email protected]> >> >Sent: Monday, July 26, 2004 9:21 PM >> >Subject: tier/remort >> > >> > >> > > I am totally stumped, and I know I am getting in over my head. >> > > >> > > I am trying to put in new tier code, that resets a player to level 1 > and >> > > allows them >> > > to choose a new path. I was trying to modify some existing tier and >> >remort >> > > code. >> > > The remort code deletes a player file and all data, which is no good >> since >> > > I want >> > > to keep all my skills/spells/stats. It works some of the time as > long >> as >> > > the update >> > > doesn't hit while you are in the tier process. If there is a tick, > and >> > > update runs, >> > > then the code blows up when ever something accesses the player_list. > I >> >cannot >> > > figure how to pull someone out of the list. I set d->connected = >> > > CON_BEGIN_ASCEND; >> > > >> > > >> > > void ascend_complete(CHAR_DATA * ch) >> > > { >> > > DESCRIPTOR_DATA *d; >> > > >> > > if (IS_NPC(ch) || (d = ch->desc) == NULL) >> > > return; >> > > >> > > if (ch->pcdata->confirm_remort) >> > > { >> > > save_char_obj(ch); >> > > stop_fighting(ch, TRUE); >> > > reduce_known_skills(ch); >> > > ch->pcdata->class_remort[ch->class] = TRUE; >> > > ch->pcdata->tier_list[class_table[ch->class].class_type]++; >> > > >> > > d->character = ch; >> > > >> > > ch->level = 1; >> > > ch->exp = 0; >> > > ch->max_hit /= 10; >> > > ch->max_mana /= 10; >> > > ch->max_move /= 10; >> > > ch->max_blood /= 10; >> > > ch->hit = UMIN(ch->hit, ch->max_hit); >> > > ch->mana = UMIN(ch->mana, ch->max_mana); >> > > ch->move = UMIN(ch->move, ch->max_move); >> > > ch->blood = UMIN(ch->blood, ch->max_blood); >> > > ch->pcdata->perm_hit = ch->max_hit; >> > > ch->pcdata->perm_mana = ch->max_mana; >> > > ch->pcdata->perm_move = ch->max_move; >> > > >> > > write_to_buffer( d, "Now beginning the ascention process.\n\r\n\r", > ); >> > > >> > > d->connected = CON_BEGIN_ASCEND; >> > > ch->pcdata->confirm_remort = FALSE; >> > > return; >> > > } >> > > } >> > > >> > > It bombs on the code below when I am in the nanny CON_BEGIN_ASCEND >> > > >> > > CREF(wch_next, CHAR_NEXT); >> > > for (wch = player_list; wch != NULL; wch = wch_next) >> > > { >> > > wch_next = wch->next_player; <=== bombs here. >> > > if (wch->in_room == NULL || IS_NPC(wch) || wch->level >= >> >LEVEL_IMMORTAL >> > > || wch->in_room == NULL || wch->in_room->area->empty) >> > > continue; >> > > >> > > >> > > -- >> > > ROM mailing list >> > > [email protected] >> > > http://www.rom.org/cgi-bin/mailman/listinfo/rom >> > > >> >> >> -- >> ROM mailing list >> [email protected] >> http://www.rom.org/cgi-bin/mailman/listinfo/rom >> >> >> -- >> ROM mailing list >> [email protected] >> http://www.rom.org/cgi-bin/mailman/listinfo/rom >> > > > > -- > ROM mailing list > [email protected] > http://www.rom.org/cgi-bin/mailman/listinfo/rom > -- ROM mailing list [email protected] http://www.rom.org/cgi-bin/mailman/listinfo/rom -- ROM mailing list [email protected] http://www.rom.org/cgi-bin/mailman/listinfo/rom

