As you can probably tell from the post, my problem is this.
[*****] BUG: Load_char_obj: # not found.
The little bit of script there that is found is this:
/*
* Load a char and inventory into a new ch structure.
*/
#pragma warning (disable: 4101)
bool load_char_obj( DESCRIPTOR_DATA *d, char *name )
{
char strsave[_MAX_PATH];
char buf[100];
CHAR_DATA *ch;
FILE *fp;
bool found;
int stat;
ch = new_char();
ch->pcdata = new_pcdata();
d->character = ch;
ch->desc = d;
ch->name = str_dup( name );
ch->id = get_pc_id();
ch->race = race_lookup("human");
ch->act = PLR_NOSUMMON;
ch->comm = COMM_COMBINE
| COMM_PROMPT;
ch->prompt = str_dup("<%hhp %mm %vmv> ");
ch->pcdata->confirm_delete = FALSE;
ch->pcdata->pwd = str_dup( "" );
ch->pcdata->bamfin = str_dup( "" );
ch->pcdata->bamfout = str_dup( "" );
ch->pcdata->title = str_dup( "" );
for (stat =0; stat < MAX_STATS; stat++)
ch->perm_stat[stat] = 13;
ch->pcdata->condition[COND_THIRST] = 48;
ch->pcdata->condition[COND_FULL] = 48;
ch->pcdata->condition[COND_HUNGER] = 48;
ch->pcdata->security = 0; /* OLC */
found = TRUE;
fclose( fpReserve );
#if defined(unix)
/* decompress if .gz file exists */
sprintf( strsave, "%s%s%s", PLAYER_DIR, capitalize(name),".gz");
if ( ( fp = fopen( strsave, "r" ) ) != NULL )
{
fclose(fp);
sprintf(buf,"gzip -dfq %s",strsave);
system(buf);
}
#endif
sprintf( strsave, "%s%s", PLAYER_DIR, capitalize( name ) );
if ( ( fp = fopen( strsave, "r" ) ) != NULL )
{
int iNest;
for ( iNest = 0; iNest < MAX_NEST; iNest++ )
rgObjNest[iNest] = NULL;
found = TRUE;
for ( ; ; )
{
char letter;
char *word;
letter = fread_letter( fp );
if ( letter == '*' )
{
fread_to_eol( fp );
continue;
}
if ( letter != '*' )
{
bug( "Load_char_obj: # not found.", 0 );
break;
}
word = fread_word( fp );
if ( !str_cmp( word, "PLAYER" ) ) ( ch, fp );
else if ( !str_cmp( word, "OBJECT" ) ) fread_obj ( ch, fp );
else if ( !str_cmp( word, "O" ) ) fread_obj ( ch, fp );
else if ( !str_cmp( word, "PET" ) ) fread_pet ( ch, fp );
else if ( !str_cmp( word, "END" ) ) break;
else
{
bug( "Load_char_obj: bad section.", 0 );
break;
}
}
fclose( fp );
}
fpReserve = fopen( NULL_FILE, "r" );
/* initialize race */
if (found)
{
int i;
if (ch->race == 0)
ch->race = race_lookup("human");
ch->size = pc_race_table[ch->race].size;
ch->dam_type = 17; /*punch */
for (i = 0; i < 5; i++)
{
if (pc_race_table[ch->race].skills[i] == NULL)
break;
group_add(ch,pc_race_table[ch->race].skills[i],FALSE);
}
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;
}
/* RT initialize skills */
if (found && ch->version < 2) /* need to add the new skills */
{
group_add(ch,"rom basics",FALSE);
group_add(ch,class_table[ch->ch_class].base_group,FALSE);
group_add(ch,class_table[ch->ch_class].default_group,TRUE);
ch->pcdata->learned[gsn_recall] = 50;
}
/* fix levels */
if (found && ch->version < 3 && (ch->level > 35 || ch->trust > 35))
{
switch (ch->level)
{
case(40) : ch->level = MAX_LEVEL; break; /* imp -> imp */
case(39) : ch->level = MAX_LEVEL-2; break; /* god -> supreme */
case(38) : ch->level = MAX_LEVEL-4; break; /* deity -> god */
case(37) : ch->level = MAX_LEVEL-6; break; /* angel -> demigod */
}
switch (ch->trust)
{
case(40) : ch->trust = MAX_LEVEL; break; /* imp -> imp */
case(39) : ch->trust = MAX_LEVEL-2; break; /* god -> supreme */
case(38) : ch->trust = MAX_LEVEL-4; break; /* deity -> god */
case(37) : ch->trust = MAX_LEVEL-6; break; /* angel -> demigod */
case(36) : ch->trust = MAX_LEVEL-8; break; /* hero -> hero */
}
}
/* ream gold */
if (found && ch->version < 4)
{
ch->gold /= 100;
}
return found;
}
#pragma warning (default: 4101)
Now, I don't quite know what im doing wrong, or what my eyes are not showing me, but I seem to keep missing the freakin error, hehe.
As you can tell, im really new to coding muds, and this is basicly my first shot at trying to do some coding by myself.
I'm am using the Win32 port of ROM from Micheal K. Weise.
Anyways, when I load a character, this is the screen while using the correct password:
By what name do you wish to be known? Rayne
Password: testpwd
Wrong password.
(this is inside the mud, not the cmd window)
Now, this is what happens if I don't enter a pword, and just hit enter instead.
Warning! Null password!
Please report old password with bug.
Type 'password null <new password>' to fix.
(This is inside the mud, not the cmd window)
I wanted to get this problem fixed before I get into the coding of this. Also, another thing that I noticed is that when i first create the character as a elf warrior, and when I enter the game again using that pfile (after I save), he's not set to human mage.
Please help out
Thanks,
Rayne Wallace |