diff options
Diffstat (limited to 'src/char_sql')
-rw-r--r-- | src/char_sql/char.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c index 090850e3a..d0e5643cc 100644 --- a/src/char_sql/char.c +++ b/src/char_sql/char.c @@ -1373,11 +1373,9 @@ int delete_char_sql(int char_id) Sql_ShowDebug(sql_handle); //Delete all pets that are stored in eggs (inventory + cart) - if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE pet_id IN " - "(SELECT card1|card2<<2 FROM `%s` WHERE char_id = '%d' AND card0 = -256" - " UNION" - " SELECT card1|card2<<2 FROM `%s` WHERE char_id = '%d' AND card0 = -256)", - pet_db, inventory_db, char_id, cart_db, char_id) ) + if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` USING `%s` JOIN `%s` ON `pet_id` = `card1`|`card2`<<16 WHERE `%s`.char_id = '%d' AND card0 = -256", pet_db, pet_db, inventory_db, inventory_db, char_id) ) + Sql_ShowDebug(sql_handle); + if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` USING `%s` JOIN `%s` ON `pet_id` = `card1`|`card2`<<16 WHERE `%s`.char_id = '%d' AND card0 = -256", pet_db, pet_db, cart_db, cart_db, char_id) ) Sql_ShowDebug(sql_handle); /* remove homunculus */ |