From b6b59bf78e91dbbef2c52682bef631be019964e3 Mon Sep 17 00:00:00 2001 From: toms Date: Tue, 15 Aug 2006 23:05:29 +0000 Subject: 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 --- Changelog-Trunk.txt | 1 + src/char_sql/int_homun.c | 26 +++++++++++++++++--------- 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index d191b8d08..bb8e94b2b 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -4,6 +4,7 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. 2006/08/15 + * Delete homunc's skills from sql when the homunc is destroyed [Toms] * Homunc Timers should be disabled when the homunc is vaporized or dead an re-enabled on call/resu [Toms] * Updated vc-project files to compile with the new int_homun files. [Skotlex] 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){ -- cgit v1.2.3-70-g09d2