summaryrefslogtreecommitdiff
path: root/src/char_sql/char.c
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-24 03:45:45 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-24 03:45:45 +0000
commitf3d5e6ef7b9e66bcf04ee91b0cd706c5a5c70a12 (patch)
treeaaffbb3b1153c55d0e5015a412d519857210e5bd /src/char_sql/char.c
parent6a6ecaf8ff94fb319767c2707f06087415624637 (diff)
downloadhercules-f3d5e6ef7b9e66bcf04ee91b0cd706c5a5c70a12.tar.gz
hercules-f3d5e6ef7b9e66bcf04ee91b0cd706c5a5c70a12.tar.bz2
hercules-f3d5e6ef7b9e66bcf04ee91b0cd706c5a5c70a12.tar.xz
hercules-f3d5e6ef7b9e66bcf04ee91b0cd706c5a5c70a12.zip
Fix
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@764 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql/char.c')
-rw-r--r--src/char_sql/char.c16
1 files changed, 10 insertions, 6 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");