Hey everyone...
Please excuse the length of this mail. I'm of course still learning as I
go...Ive been doing this a little while now and have come across this...A
seg fault with Edwin's Class2 (class editor). I was checking things out and
of course this is a life saver as editing for classes is a pain. I have
added classes by hand before and decided to add this snippet. I checked the
archives and didnt see anything that is really relevant to this. I compile
and get this seg fault....
Program received signal SIGSEGV, Segmentation fault.
0x080774e1 in load_classes () at class.c:112
112 skill_table[j].skill_level[i] =
LEVEL_IMMORTAL;
I notice if has to do with skill_table so in GDB I typed 'p skill_table' and
get this....
$3 = {{name = 0x80eb176 "reserved", skill_level = {299, 299, 299, 299, 299},
rating = {299, 299,
299, 299, 299}, spell_fun = 0, target = 0, minimum_position = 8, pgsn
= 0x0, slot = 0,
min_mana = 0, beats = 0, noun_damage = 0x80eb175 "", msg_off = 0x80eb175
"",
msg_obj = 0x80eb175 ""}, {name = 0x80eb16a "acid blast", skill_level =
{28, 201, 35, 32,
28}, rating = {1, 1, 2, 2, 2}, spell_fun = 0x80933fc
<spell_acid_blast>, target = 1,
minimum_position = 7, pgsn = 0x0, slot = 70, min_mana = 20, beats = 12,
noun_damage = 0x80eb16a "acid blast", msg_off = 0x80eb15d "!Acid
Blast!", msg_obj = 0x0}, {
name = 0x80e4092 "armor", skill_level = {7, 2, 10, 5, 4}, rating = {1,
1, 2, 2, 1},
spell_fun = 0x8093458 <spell_armor>, target = 2, minimum_position = 8,
pgsn = 0x0, slot = 1,
min_mana = 5, beats = 12, noun_damage = 0x80eb175 "",
<snipped>
noun_damage = 0x80eb175 "", msg_off = 0x80ea168 "!Wands!", msg_obj =
0x80eb175 ""}, {
name = 0x80ea161 "recall", skill_level = {1, 1, 1, 1, 1}, rating = {2,
2, 2, 2, 2},
spell_fun = 0x8098b80 <spell_null>, target = 0, minimum_position = 8,
pgsn = 0x8131200,
slot = 0, min_mana = 0, beats = 12, noun_damage = 0x80eb175 "",
msg_off = 0x80ea158 "!Recall!", msg_obj = 0x80eb175 ""}, {name = 0x0,
skill_level = {0, 0,
0, 0, 0}, rating = {0, 0, 0, 0, 0}, spell_fun = 0, target = 0,
minimum_position = 0,
pgsn = 0x0, slot = 0, min_mana = 0, beats = 0, noun_damage = 0x0,
msg_off = 0x0,
msg_obj = 0x0} <repeats 18 times>}
I snipped it as it was quite long...the section of the code follows...
void load_classes ()
{
int i,j;
for (i = 0; i < MAX_CLASS; i++)
{
for (j = 0; j < MAX_SKILL; j++)
--->112 skill_table[j].skill_level[i] = LEVEL_IMMORTAL;
load_class (i);
}
}
ANY help would be more than appreciated! Thanks!
Jim