summaryrefslogtreecommitdiff
path: root/src/char_sql/char.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-09-02 21:18:33 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2008-09-02 21:18:33 +0000
commit2b5634faa20cdac69f94ba5abd4ea3fca8c44c2d (patch)
tree7d5422070e550df48472ace99eabd3640974402d /src/char_sql/char.c
parentf4444897e96b9278ca952686e7dc0561a8b30efc (diff)
downloadhercules-2b5634faa20cdac69f94ba5abd4ea3fca8c44c2d.tar.gz
hercules-2b5634faa20cdac69f94ba5abd4ea3fca8c44c2d.tar.bz2
hercules-2b5634faa20cdac69f94ba5abd4ea3fca8c44c2d.tar.xz
hercules-2b5634faa20cdac69f94ba5abd4ea3fca8c44c2d.zip
- Fixed problem deleting characters.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13186 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql/char.c')
-rw-r--r--src/char_sql/char.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 52572fa88..93a7563d2 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -1297,11 +1297,11 @@ int delete_char_sql(int char_id)
{
char name[NAME_LENGTH];
char esc_name[NAME_LENGTH*2+1]; //Name needs be escaped.
- int account_id, party_id, guild_id, hom_id, mer_id, base_level, partner_id, father_id, mother_id;
+ int account_id, party_id, guild_id, hom_id, base_level, partner_id, father_id, mother_id;
char* data;
size_t len;
- if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `name`,`account_id`,`party_id`,`guild_id`,`base_level`,`homun_id`,`mer_id`,`partner_id`,`father`,`mother` FROM `%s` WHERE `char_id`='%d'", char_db, char_id) )
+ if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `name`,`account_id`,`party_id`,`guild_id`,`base_level`,`homun_id`,`partner_id`,`father`,`mother` FROM `%s` WHERE `char_id`='%d'", char_db, char_id) )
Sql_ShowDebug(sql_handle);
if( SQL_SUCCESS != Sql_NextRow(sql_handle) )
@@ -1317,10 +1317,9 @@ int delete_char_sql(int char_id)
Sql_GetData(sql_handle, 3, &data, NULL); guild_id = atoi(data);
Sql_GetData(sql_handle, 4, &data, NULL); base_level = atoi(data);
Sql_GetData(sql_handle, 5, &data, NULL); hom_id = atoi(data);
- Sql_GetData(sql_handle, 6, &data, NULL); mer_id = atoi(data);
- Sql_GetData(sql_handle, 7, &data, NULL); partner_id = atoi(data);
- Sql_GetData(sql_handle, 8, &data, NULL); father_id = atoi(data);
- Sql_GetData(sql_handle, 9, &data, NULL); mother_id = atoi(data);
+ Sql_GetData(sql_handle, 6, &data, NULL); partner_id = atoi(data);
+ Sql_GetData(sql_handle, 7, &data, NULL); father_id = atoi(data);
+ Sql_GetData(sql_handle, 8, &data, NULL); mother_id = atoi(data);
Sql_EscapeStringLen(sql_handle, esc_name, name, min(len, NAME_LENGTH));
Sql_FreeResult(sql_handle);
@@ -1374,9 +1373,8 @@ int delete_char_sql(int char_id)
/* remove homunculus */
if( hom_id )
mapif_homunculus_delete(hom_id);
- /* remove mercenary */
- if( mer_id )
- mapif_mercenary_delete(mer_id);
+
+ /* remove mercenary data */
mercenary_owner_delete(char_id);
/* delete char's friends list */