Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- in save_char function I have
- /* Save Skills */
- for (i = 1; i <= SK_ARRAY_MAX; i++) {
- if (GET_SKILL_RANK(ch, i))
- fprintf(fl, "Skil: %d %d/%d\n", GET_SKILL(ch, i), GET_SKILL_RANK(ch, i), GET_SKILL_XP(ch, i));
- }
- // I believe the skills are correctly saving because when I modify a skill, save the character, and open the pfile while the character is loaded the skills are saved into the pfile
- under load_char I have
- case 'S':
- if (!strcmp(tag, "Sex ")) GET_SEX(ch) = atoi(line);
- else if (!strcmp(tag, "ScrW")) GET_SCREEN_WIDTH(ch) = atoi(line);
- else if (!strcmp(tag, "Skil"))load_skills(ch, line, LOAD_SKILL);
- and then the load_skills function is
- static void load_skills(struct char_data *ch, const char *line, int mode) {//(FILE *fl, struct char_data *ch) {
- int num = 0, num2 = 0, num3 = 0;
- int i;
- sscanf(line, "%d %d/%d", &num, &num2, &num3);
- switch (mode) {
- case LOAD_SKILL:
- // GET_SKILL(ch, i) = num;
- GET_SKILL_RANK(ch, num) = num2;
- GET_SKILL_XP(ch, num) = num3;
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment