diff options
author | toms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-15 23:05:29 +0000 |
---|---|---|
committer | toms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-08-15 23:05:29 +0000 |
commit | b6b59bf78e91dbbef2c52682bef631be019964e3 (patch) | |
tree | 157b25a6332da02aecb5a4bfb2d1654426f1aea6 /src/char_sql | |
parent | 40623a768b067f146043eaf93b77d35251c5c4d3 (diff) | |
download | hercules-b6b59bf78e91dbbef2c52682bef631be019964e3.tar.gz hercules-b6b59bf78e91dbbef2c52682bef631be019964e3.tar.bz2 hercules-b6b59bf78e91dbbef2c52682bef631be019964e3.tar.xz hercules-b6b59bf78e91dbbef2c52682bef631be019964e3.zip |
Delete homunc's skills from sql when the homunc is destroyed
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8307 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r-- | src/char_sql/int_homun.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/char_sql/int_homun.c b/src/char_sql/int_homun.c index 576b9a809..f7ff0046f 100644 --- a/src/char_sql/int_homun.c +++ b/src/char_sql/int_homun.c @@ -32,10 +32,10 @@ void inter_homunculus_sql_final(void){ return;
}
-int mapif_saved_homunculus(int fd, int account_id, short flag)
+int mapif_saved_homunculus(int fd, int account_id, unsigned char flag)
{
WFIFOW(fd,0) = 0x3892;
- WFIFOL(fd,2)=account_id;
+ WFIFOL(fd,2) = account_id;
WFIFOB(fd,6) = flag;
WFIFOSET(fd, 7);
return 0;
@@ -227,13 +227,21 @@ int mapif_load_homunculus(int fd){ int mapif_delete_homunculus(int fd)
{
sprintf(tmp_sql, "DELETE FROM `homunculus` WHERE `homun_id` = '%lu'", RFIFOL(fd,2));
- if(mysql_query(&mysql_handle, tmp_sql)){
- ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
- return mapif_homunculus_deleted(fd, 0);
- }
-
- return mapif_homunculus_deleted(fd, 1);
+ if(mysql_query(&mysql_handle, tmp_sql))
+ {
+ ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ return mapif_homunculus_deleted(fd, 0);
+ }
+
+ sprintf(tmp_sql, "DELETE FROM `skill_homunculus` WHERE `homun_id` = '%lu'", RFIFOL(fd,2));
+ if(mysql_query(&mysql_handle, tmp_sql))
+ {
+ ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
+ ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ return mapif_homunculus_deleted(fd, 0);
+ }
+ return mapif_homunculus_deleted(fd, 1);
}
int mapif_rename_homun_ack(int fd, int account_id, int char_id, int flag, char *name){
|