mystickdreamer

Untitled

Dec 1st, 2014
232
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.59 KB | None | 0 0
  1. // define for the load_skills switch
  2. #define LOAD_SKILL  0
  3.  
  4. /* local functions */
  5.  
  6. static void load_skills(struct char_data *ch, const char *line, int mode);//(FILE *fl, struct char_data *ch);
  7.  
  8.  
  9.  
  10.  
  11. under load_char:
  12.  
  13.  
  14.         /* Character initializations. Necessary to keep some things straight. */
  15.         ch->affected = NULL;
  16.         for (i = 1; i <= SK_ARRAY_MAX; i++) {
  17.             SET_SKILL(ch, i, 0);
  18.         }
  19.  
  20.  
  21.  
  22.  
  23.  
  24. case 'S':
  25.                     if (!strcmp(tag, "Sex ")) GET_SEX(ch) = atoi(line);
  26.                     else if (!strcmp(tag, "ScrW")) GET_SCREEN_WIDTH(ch) = atoi(line);
  27.                     else if (!strcmp(tag, "Skil"))load_skills(ch, line, LOAD_SKILL);
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34.  
  35. static void load_skills (struct char_data *ch, const char *line, int mode) {//(FILE *fl, struct char_data *ch) {
  36.     int num = 0, num2 = 0, i;
  37.  
  38.     sscanf(line, "%d/%d", &num, &num2);
  39.     sscanf(line, "%d/%d", GET_SKILL_RANK(ch, i), GET_SKILL_XP(ch, i))
  40.    
  41.     switch (mode) {
  42.         case LOAD_SKILL:
  43.         GET_SKILL_RANK(ch, i) = num;
  44.         GET_SKILL_XP(ch, i) = num2;
  45.         break;
  46.     }
  47.     /*
  48.     do {
  49.         get_line(fl, line);
  50.         sscanf(line, "%d %d %d", &num, &num2, &num3);
  51.         if (num != 0)
  52.             SET_SKILL(ch, num, num2, num3);
  53.     } while (num != 0); */
  54. }
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61. here is what is in save_char
  62.  
  63.  
  64.     /* Save skills */
  65.     //if (GET_ADMLEVEL(ch) < ADMLVL_IMMORT) {
  66.         for (i = 1; i <= SK_ARRAY_MAX; i++) {
  67.             if (GET_SKILL_RANK(ch, i))
  68.                 fprintf(fl, "Skil: %d/%d\n", GET_SKILL_RANK(ch, i), GET_SKILL_XP(ch, i));
  69.         }
Advertisement
Add Comment
Please, Sign In to add comment