D20 Link: http://cid-1573e9686728b039.skydrive.live.com/self.aspx/.Public/d20MUD.zip
Ok upon choosing your class, it core dumps.
running GDB I find.
Program received signal SIGSEGV, Segmentation fault.
0x08176c17 in display_levelup_changes (ch=0x9872b28, apply_changes=1) at interpreter.c:4062
4062 if (ch->levelup->skills[i] > 0) {
(gdb)
(gdb) run -q -p 4796
The program being debugged has been started already.
Start it from the beginning? (y or n) n
Please answer y or n.
The program being debugged has been started already.
Start it from the beginning? (y or n) Program not restarted.
(gdb) where
#0 0x08176c17 in display_levelup_changes (ch=0x9872b28, apply_changes=1) at interpreter.c:4062
#1 0x080d8673 in do_advance_level (ch=0x9872b28, whichclass=0, manual=1) at class.c:3779
#2 0x080d59a8 in advance_level (ch=0x9872b28, whichclass=0) at class.c:3175
#3 0x081780e3 in gain_level (ch=0x9872b28, whichclass=0) at limits.c:363
#4 0x0815ac51 in handle_gain (keeper=0x95d7930, guild_nr=0, ch=0x9872b28, argument=0xbfbc3125 "mage") at guild.c:918
#5 0x0815c670 in guild (ch=0x9872b28, me=0x95d7930, cmd=161, argument=0xbfbc3124 " mage") at guild.c:1419
#6 0x0816ec63 in special (ch=0x9872b28, cmd=161, arg=0xbfbc3124 " mage") at interpreter.c:1801
#7 0x0816d467 in command_interpreter (ch=0x9872b28, argument=0xbfbc3120 "gain mage") at interpreter.c:1089
#8 0x080dfa7c in game_loop (mother_desc=6) at comm.c:965
#9 0x080def24 in init_game (port=4796) at comm.c:586
#10 0x080de902 in main (argc=4, argv=0xbfbc5474) at comm.c:417
(gdb) Quit
Now it has been the better part of about 12 years since I dabbled with muds or any *nix environment but it's coming back to me slowly. Line 0 is my problem area correct?
And if so can any one see what might be wrong with this?
void display_levelup_changes(struct char_data *ch, int apply_changes) {
int i = 0;
send_to_char(ch,
"\r\n"
"Your Level Summary:\r\n"
"\r\n"
"Skills:\r\n"
"\r\n"
);
for (i = 0; i < SKILL_TABLE_SIZE + 1; i++) {
if (ch->levelup->skills[i] > 0) { /* THIS SEEMS TO BE THE PROBLEM HERE -SOKOL */
send_to_char(ch, "%s raised from %d to %d.\r\n", spell_info[i].name, GET_SKILL(ch, i), GET_SKILL(ch, i) +ch->levelup->skills[i]);
if (apply_changes)
GET_SKILL_BASE(ch, i) += ch->levelup->skills[i];
}
}
send_to_char(ch,
"\r\n"
"Feats:\r\n"
"\r\n"
);
for (i = 0; i < NUM_FEATS_DEFINED; i++) {
if (ch->levelup->feats[i] > 0) {
send_to_char(ch, "%s", feat_list[i].name);
if (apply_changes)
HAS_FEAT(ch, i)++;
switch (i) {
case FEAT_IMPROVED_CRITICAL:
case FEAT_WEAPON_FINESSE:
case FEAT_WEAPON_FOCUS:
case FEAT_WEAPON_SPECIALIZATION:
case FEAT_GREATER_WEAPON_FOCUS:
case FEAT_GREATER_WEAPON_SPECIALIZATION:
case FEAT_IMPROVED_WEAPON_FINESSE:
case FEAT_EXOTIC_WEAPON_PROFICIENCY:
case FEAT_MONKEY_GRIP:
case FEAT_POWER_CRITICAL:
if (apply_changes)
SET_COMBAT_FEAT(ch, feat_to_subfeat(i), ch->levelup->feat_weapons[i]);
send_to_char(ch, " (%s)", weapon_list[ch->levelup->feat_weapons[i]].name);
break;
case FEAT_SKILL_FOCUS:
case FEAT_EPIC_SKILL_FOCUS:
if (apply_changes)
ch->player_specials->skill_focus[ch->levelup->feat_skills[i] - SKILL_LOW_SKILL] += 1;
send_to_char(ch, " (%s)", spell_info[ch->levelup->feat_skills[i]].name);
break;
}
send_to_char(ch, "\r\n");
}
}
send_to_char(ch,
"\r\n"
"Ability Score Trains:\r\n"
"\r\n"
);
for (i = 0; i < 6; i++) {
if (ch->levelup->trains[i] > 0) {
switch (i) {
case 0:
if (apply_changes)
ch->real_abils.str += ch->levelup->trains[i];
send_to_char(ch, "Strength raised from %d to %d.\r\n", ch->real_abils.str, ch->real_abils.str + ch->levelup->trains[i]);
break;
case 1:
if (apply_changes)
ch->real_abils.dex += ch->levelup->trains[i];
send_to_char(ch, "Dexterity raised from %d to %d.\r\n", ch->real_abils.dex, ch->real_abils.dex + ch->levelup->trains[i]);
break;
case 2:
if (apply_changes)
ch->real_abils.con += ch->levelup->trains[i];
send_to_char(ch, "Constitution raised from %d to %d.\r\n", ch->real_abils.con, ch->real_abils.con + ch->levelup->trains[i]);
break;
case 3:
if (apply_changes)
ch->real_abils.intel += ch->levelup->trains[i];
send_to_char(ch, "Intelligence raised from %d to %d.\r\n", ch->real_abils.intel, ch->real_abils.intel + ch->levelup->trains[i]);
break;
case 4:
if (apply_changes)
ch->real_abils.wis += ch->levelup->trains[i];
send_to_char(ch, "Wisdom raised from %d to %d.\r\n", ch->real_abils.wis, ch->real_abils.wis + ch->levelup->trains[i]);
break;
case 5:
if (apply_changes)
ch->real_abils.cha += ch->levelup->trains[i];
send_to_char(ch, "Charisma raised from %d to %d.\r\n", ch->real_abils.cha, ch->real_abils.cha + ch->levelup->trains[i]);
break;
}
}
}
}
So it seems:
if (ch->levelup->skills[i] > 0) { /* THIS SEEMS TO BE THE PROBLEM HERE -SOKOL */
Thanks,
Sokol

