Hi!
I've been trying to debug this for over a week now, I hope someone here can help out a bit. Right now when I try to use the command: sset save skill table, the entire mud goes down. So I went and put bug()'s in the code, and this is what it produced:
sset save skill table
Log: Valens: sset save skill table
Log: [*****] BUG: here?
Saving skill table...
Log: [*****] BUG: Here 2?
Log: [*****] BUG: 3?
Log: [*****] BUG: 8?
Log: [*****] BUG: 9?
Log: [*****] BUG: last
And this is the code:
Does anyone see what's wrong with it? Or have a suggestion on how to solve this problem?
I've been trying to debug this for over a week now, I hope someone here can help out a bit. Right now when I try to use the command: sset save skill table, the entire mud goes down. So I went and put bug()'s in the code, and this is what it produced:
sset save skill table
Log: Valens: sset save skill table
Log: [*****] BUG: here?
Saving skill table...
Log: [*****] BUG: Here 2?
Log: [*****] BUG: 3?
Log: [*****] BUG: 8?
Log: [*****] BUG: 9?
Log: [*****] BUG: last
And this is the code:
void save_skill_table()
{
int x;
int sn;
FILE *fpout;
if ( (fpout=fopen( SKILL_FILE, "w" )) == NULL )
{
bug( "Here 1?", 0);
perror( SKILL_FILE );
bug( "Cannot open skills.dat for writting", 0 );
return;
}
bug( "Here 2?", 0);
for ( x = 0; x < top_sn; x++ )
{
bug( "3?", 0);
if ( !skill_table[x]->name || skill_table[x]->name[0] == '\0' )
bug( "4?", 0);
break;
if ( SPELL_FLAG(get_skilltype(sn), SF_DELETED))
bug( "5?", 0);
continue;
fprintf( fpout, "#SKILL\n" );
bug( "6?", 0);
fwrite_skill( fpout, skill_table[x] );
bug( "7", 0);
}
bug( "8?", 0);
fprintf( fpout, "#END\n" );
bug( "9?", 0);
fclose( fpout );
bug( "last", 0);
}
Does anyone see what's wrong with it? Or have a suggestion on how to solve this problem?