From 9b6610e12b484d9bb4b295a5fc609a3eed7f9940 Mon Sep 17 00:00:00 2001 From: ultramage Date: Wed, 22 Jun 2011 20:11:48 +0000 Subject: Added enum e_skill_flag to represent the values of struct s_skill's complicated 'flag' field. Reordered the enum values so SKILL_FLAG_REPLACED_LV_0 goes last and arithmetic can be done on it safely (for storing skill level values). This also adds support for skill levels higher than 10. Fixed several places where SKILL_FLAG_TEMPORARY was not handled properly, and instead was considered as one of the saved skill level values (resulting in skill level -1). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14861 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char/char.c | 8 ++++---- src/char/int_homun.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/char') diff --git a/src/char/char.c b/src/char/char.c index c01c6bf30..040c05955 100644 --- a/src/char/char.c +++ b/src/char/char.c @@ -571,8 +571,8 @@ int mmo_char_tostr(char *str, struct mmo_charstatus *p, struct global_reg *reg, *(str_p++) = '\t'; for(i = 0; i < MAX_SKILL; i++) - if (p->skill[i].id && p->skill[i].flag != 1) { - str_p += sprintf(str_p, "%d,%d ", p->skill[i].id, (p->skill[i].flag == 0) ? p->skill[i].lv : p->skill[i].flag-2); + if (p->skill[i].id != 0 && p->skill[i].flag != SKILL_FLAG_TEMPORARY) { + str_p += sprintf(str_p, "%d,%d ", p->skill[i].id, (p->skill[i].flag == SKILL_FLAG_PERMANENT) ? p->skill[i].lv : p->skill[i].flag - SKILL_FLAG_REPLACED_LV_0); } *(str_p++) = '\t'; @@ -2271,7 +2271,7 @@ int parse_fromlogin(int fd) } // remove specifical skills of classes 19, 4020 and 4042 for(j = 315; j <= 322; j++) { - if (char_dat[i].status.skill[j].id > 0 && !char_dat[i].status.skill[j].flag) { + if (char_dat[i].status.skill[j].id > 0 && char_dat[i].status.skill[j].flag == SKILL_FLAG_PERMANENT) { char_dat[i].status.skill_point += char_dat[i].status.skill[j].lv; char_dat[i].status.skill[j].id = 0; char_dat[i].status.skill[j].lv = 0; @@ -2279,7 +2279,7 @@ int parse_fromlogin(int fd) } // remove specifical skills of classes 20, 4021 and 4043 for(j = 323; j <= 330; j++) { - if (char_dat[i].status.skill[j].id > 0 && !char_dat[i].status.skill[j].flag) { + if (char_dat[i].status.skill[j].id > 0 && char_dat[i].status.skill[j].flag == SKILL_FLAG_PERMANENT) { char_dat[i].status.skill_point += char_dat[i].status.skill[j].lv; char_dat[i].status.skill[j].id = 0; char_dat[i].status.skill[j].lv = 0; diff --git a/src/char/int_homun.c b/src/char/int_homun.c index d547b60f7..ec22499d0 100644 --- a/src/char/int_homun.c +++ b/src/char/int_homun.c @@ -36,7 +36,7 @@ int inter_homun_tostr(char *str,struct s_homunculus *p) for (i = 0; i < MAX_HOMUNSKILL; i++) { - if (p->hskill[i].id && !p->hskill[i].flag) + if (p->hskill[i].id && p->hskill[i].flag == SKILL_FLAG_PERMANENT) str+=sprintf(str,"%d,%d,", p->hskill[i].id, p->hskill[i].lv); } -- cgit v1.2.3-70-g09d2