heres a bug i've never come across before and i dont know what could be causing it so i figured you guys might recognize this...anyway, here's the snippet of code, this saves characters after creation(both new chars and remorts), when new chars are created theres no problem, they enter the game and can play, when its done with remort characters it always crashes at this one line, and the weird thing is that when i enter more lines, that say like "logf("3");" it'll still crash on the same line #(in the function), not necessarily the same piece of code, you see what im saying?

void save_char_creation( CHAR_DATA *ch )
{
        DESCRIPTOR_DATA *d;
        int rb,i,j,sn;

        for ( d = descriptor_list; d != NULL; d = d->next )
                if(!strcmp(d->character->name,ch->name))
                        break;
        for(rb=0;rb<pc_creating;rb++)
                if(!strcmp(create_table[rb].name,ch->name))
                        break;
        for(sn=0;sn<maxSkill;sn++)
                if(create_table[rb].skill[sn])
                {
                        ch->pcdata->has_skill[sn] = TRUE;
                        ch->pcdata->skill_level[sn] = 
skill_table[sn].rating[ch->class];
                        if(ch->pcdata->skill_level[sn] == 1 )
                                ch->pcdata->learned[sn] = 1;
                }
        for(sn=0;sn<maxGroup;sn++)
                if(create_table[rb].group[sn])
                        for(i=0;i<maxInGroup;i++)
                                if(group_table[sn].spells[i] != NULL)
                                {
                                        j = 
skill_lookup(group_table[sn].spells[i]);
                                        ch->pcdata->has_skill[j] = TRUE;
                                        ch->pcdata->skill_level[j] = 
skill_table[j].rating[ch->class];
                                        if(ch->pcdata->skill_level[j] == 1 )
                                                ch->pcdata->learned[j] = 1;
                                }
        logf("clothes:)");
        act( "$n has entered the game.", ch, NULL, NULL, TO_ROOM );
        logf("bank:)");
        ch->class    = create_table[rb].newclass;
        ch->race     = create_table[rb].race;
        ch->alignment= create_table[rb].align;
        ch->sex               = create_table[rb].gender;
        ch->gold      = 0;
        ch->primary_weap = create_table[rb].weapon;
        for (i = 0; i < MAX_STATS; i++)
            ch->perm_stat[i] = pc_race_table[ch->race].stats[i];
        ch->affected_by = ch->affected_by|race_table[ch->race].aff;
        ch->imm_flags        = ch->imm_flags|race_table[ch->race].imm;
        ch->res_flags        = ch->res_flags|race_table[ch->race].res;
        ch->vuln_flags       = ch->vuln_flags|race_table[ch->race].vuln;
        ch->form     = race_table[ch->race].form;
        ch->parts    = race_table[ch->race].parts;
        ch->size = pc_race_table[ch->race].size;
        ch->pcdata->points = create_table[rb].cp;
   SET_BIT(ch->act,PLR_AUTOASSIST);
   SET_BIT(ch->act,PLR_AUTOEXIT);
   SET_BIT(ch->act,PLR_AUTOGOLD);
   SET_BIT(ch->act,PLR_AUTOSAC);
   SET_BIT(ch->act,PLR_AUTOLOOT);
   SET_BIT(ch->act,PLR_COLOUR);
        do_function (ch, &do_outfit,"");
        obj_to_char(create_object(get_obj_index(OBJ_VNUM_MAP),0),ch);
        char_to_room( ch, get_room_index( ROOM_VNUM_SCHOOL ) );
        send_to_char("\n\r",ch);
        logf("1");
        logf("2");
        logf("3");
        do_function(ch, &do_look, "auto" );
        logf("4");
        wiznet("$N has left real life behind.",ch,NULL,
                WIZ_LOGINS,WIZ_SITES,get_trust(ch));
        if (ch->pet != NULL)
        {
                char_to_room(ch->pet,ch->in_room);
                act("$n has entered the game.",ch->pet,NULL,NULL,TO_ROOM);
        }
        do_function(ch, &do_unread, "");
        if (ch->pcdata->host == NULL
        || sizeof(ch->pcdata->host) == 0
        || !str_cmp(ch->pcdata->host, "none"))
                ptc(ch, "{cUpdating site login info: {y%s{x\n\r", d->host);
        else if (!str_cmp(ch->pcdata->host, d->host))
                ptc(ch, "{cUsual login: {y%s{x\n\r", ch->pcdata->host);
        else
                ptc(ch,"{cLast login: {y%s{x\n\r"
                                "{cCurrent login: {y%s{x\n\r",
                                ch->pcdata->host,d->host);

        ch->pcdata->host = str_dup(d->host);
   ch->pcdata->confirm_delete             = FALSE;
   ch->pcdata->confirm_rebirth            = FALSE;
        ch->pcdata->creation = FALSE;
        pc_creating--;
        return;
}

_________________________________________________________________
Take advantage of powerful junk e-mail filters built on patented Microsoft® SmartScreen Technology. http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines Start enjoying all the benefits of MSN® Premium right now and get the first two months FREE*.

Reply via email to