diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/char_sql/char.c | 16 | ||||
-rw-r--r-- | src/map/pc.c | 3 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c index b390b2c82..f637e0683 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -543,12 +543,16 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus *p){ } diff = 0; - for(i=0;i<MAX_SKILL;i++) - if((p->skill[i].id != cp->skill[i].id) || (p->skill[i].lv != cp->skill[i].lv) || - (p->skill[i].flag != cp->skill[i].flag)) { - diff = 1; - break; - } + for(i=0;i<MAX_SKILL;i++) { + if ((p.skill[i].lv != 0) && (p.skill[i].id == 0)) + p->skill[i].id = i; + + if((p->skill[i].id != cp->skill[i].id) || (p->skill[i].lv != cp->skill[i].lv) || + (p->skill[i].flag != cp->skill[i].flag)) { + diff = 1; + break; + } + } if (diff) { //printf("- Save skill data to MySQL!\n"); diff --git a/src/map/pc.c b/src/map/pc.c index 151ec47a3..aab6e406b 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -416,8 +416,7 @@ int pc_makesavestatus(struct map_session_data *sd) sd->status.skill[i].id=0; sd->status.skill[i].lv=0; sd->status.skill[i].flag=0; - } else if ((sd->status.skill[i].lv != 0) && (sd->status.skill[i].id == 0)) - sd->status.skill[i].id = i; + } } return 0; |