summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-30 09:21:28 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-30 09:21:28 +0000
commit62ba3401df75d514b91aa7e1b2f818609950f735 (patch)
tree3d4c22de62871e8dc6c199a9d08360f39bdf4cff /src/char_sql
parent7ceb4db245c386772e57b1f7be8793f75f18a0c0 (diff)
downloadhercules-62ba3401df75d514b91aa7e1b2f818609950f735.tar.gz
hercules-62ba3401df75d514b91aa7e1b2f818609950f735.tar.bz2
hercules-62ba3401df75d514b91aa7e1b2f818609950f735.tar.xz
hercules-62ba3401df75d514b91aa7e1b2f818609950f735.zip
Fixed sql char deletion code using a broken pet deletion query (ran very slow, and had a typo in a binary shift operation) (bugreport:3304).
Fixed change r13774 to the code responsible for deciding whether to move 1 extra cell when stopping walking; it had its logic inverted by mistake (bugreport:3312). Cleaned up the itemlist, cartlist and storagelist gm command code: - fixed buffer overflows in all three functions (bugreport:456). - merged all three atcommand functions into a single one; the appropriate behavior is detected from the command's name. - using the StringBuf class instead of static-size buffers and string operations for more efficient and safe processing. - using 'jname' (the one without underscores) as the primary item name in the list, and not using the aegis name for cards at all (since it's almost identical). - fixed forged item details never being displayed due to a missing strcat(). - extended item info (crafted/named items, pet eggs) will now be displayed for storage and cart list as well. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13920 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/char.c8
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 */