I know its a general term, probably meaning something is null. I'll paste the function first and the error from gdb/cygwin.
Program received signal SIGSEGV, Segmentation fault.
0x004b1b23 in get_free_order_position (ch=0xa28bb20, tier=8448)
at music.c:1110
warning: Source file is more recent than executable.
1110 if ( ch->pcdata->skills[tier][x][0] < 1 )
(gdb) bt
#0 0x004b1b23 in get_free_order_position (ch=0xa28bb20, tier=8448)
at music.c:1110
#1 0x004b1b75 in trom_giveskill (ch=0xa28bb20, skill_num=-1, percent=1)
at music.c:1123
#2 0x0044e457 in nanny (d=0xa28a4b8, argument=0xa28ae35 "human")
at comm.c:3011
#3 0x00449945 in game_loop_unix (control=4, wwwcontrol=5) at comm.c:862
#4 0x004491ce in main (argc=1, argv=0xa041610) at comm.c:472
This error occurs when the character is being loaded and skills are being placed into the ch structure. The tier is taken from the skills table which i modified accordingly, it should be perfect, no values are under 0. x integer counts from 0 to 19 (thats how big the 2nd part of the array is [skills[4][19][1]]. Now for the function itself
int get_free_order_position ( CHAR_DATA *ch, int tier ) {
if ( tier < 0 || ch->pcdata == NULL )
return -1;
int x = 0;
while ( x <= 19 ) {
// if theres a vacant skill position, return the location!
if ( ch->pcdata->skills[tier][x][0] < 1 )
return x;
x++;
}
// no positions free for the class
return -1;
}
I've been here a while ago asking questions about errors. I've used all the previous methods of error reductions and came across this. I've checked out ch->pcdata and ch->pcdata->skills and they are not null. They are both initialized around the time the name is entered. The process crashes after the name and password is taken and the new character chooses a race. It then goes to class selection i think, or sometime before that it just flops with a segmentation fault error.
If you guys got any suggestions, it would be appreciated.
Program received signal SIGSEGV, Segmentation fault.
0x004b1b23 in get_free_order_position (ch=0xa28bb20, tier=8448)
at music.c:1110
warning: Source file is more recent than executable.
1110 if ( ch->pcdata->skills[tier][x][0] < 1 )
(gdb) bt
#0 0x004b1b23 in get_free_order_position (ch=0xa28bb20, tier=8448)
at music.c:1110
#1 0x004b1b75 in trom_giveskill (ch=0xa28bb20, skill_num=-1, percent=1)
at music.c:1123
#2 0x0044e457 in nanny (d=0xa28a4b8, argument=0xa28ae35 "human")
at comm.c:3011
#3 0x00449945 in game_loop_unix (control=4, wwwcontrol=5) at comm.c:862
#4 0x004491ce in main (argc=1, argv=0xa041610) at comm.c:472
This error occurs when the character is being loaded and skills are being placed into the ch structure. The tier is taken from the skills table which i modified accordingly, it should be perfect, no values are under 0. x integer counts from 0 to 19 (thats how big the 2nd part of the array is [skills[4][19][1]]. Now for the function itself
int get_free_order_position ( CHAR_DATA *ch, int tier ) {
if ( tier < 0 || ch->pcdata == NULL )
return -1;
int x = 0;
while ( x <= 19 ) {
// if theres a vacant skill position, return the location!
if ( ch->pcdata->skills[tier][x][0] < 1 )
return x;
x++;
}
// no positions free for the class
return -1;
}
I've been here a while ago asking questions about errors. I've used all the previous methods of error reductions and came across this. I've checked out ch->pcdata and ch->pcdata->skills and they are not null. They are both initialized around the time the name is entered. The process crashes after the name and password is taken and the new character chooses a race. It then goes to class selection i think, or sometime before that it just flops with a segmentation fault error.
If you guys got any suggestions, it would be appreciated.