summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-13 18:25:52 +0000
committerepoque11 <epoque11@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-12-13 18:25:52 +0000
commit5639dfef5d48e34e9bae6729527567daf6250371 (patch)
tree1f6c1d349ced44a0fc6838467f72390d26fc6800
parenta16f0b861a2fa16b9a07e252b7cfd65cea28b85b (diff)
downloadhercules-5639dfef5d48e34e9bae6729527567daf6250371.tar.gz
hercules-5639dfef5d48e34e9bae6729527567daf6250371.tar.bz2
hercules-5639dfef5d48e34e9bae6729527567daf6250371.tar.xz
hercules-5639dfef5d48e34e9bae6729527567daf6250371.zip
- Fixed char-server saving skills which have no level associated with them
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15092 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--src/char_sql/char.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 19ea01f66..ed6940228 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -608,8 +608,12 @@ int mmo_char_tosql(int char_id, struct mmo_charstatus* p)
//insert here.
for( i = 0, count = 0; i < MAX_SKILL; ++i )
{
- if(p->skill[i].id != 0 && p->skill[i].flag != SKILL_FLAG_TEMPORARY)
+ if( p->skill[i].id != 0 && p->skill[i].flag != SKILL_FLAG_TEMPORARY )
{
+ if( p->skill[i].flag == SKILL_FLAG_PERMANENT && p->skill[i].lv == 0 )
+ continue;
+ if( p->skill[i].flag != SKILL_FLAG_PERMANENT && (p->skill[i].flag - SKILL_FLAG_REPLACED_LV_0) == 0 )
+ continue;
if( count )
StringBuf_AppendStr(&buf, ",");
StringBuf_Printf(&buf, "('%d','%d','%d')", char_id, p->skill[i].id, (p->skill[i].flag == SKILL_FLAG_PERMANENT ? p->skill[i].lv : p->skill[i].flag - SKILL_FLAG_REPLACED_LV_0));