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