summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-16 03:55:16 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-08-16 03:55:16 +0000
commitccc18ecfe671803c6d6b9b6dd790c45cdf28c9ac (patch)
tree32080748dda610463675b67d97bbfef6d75cccf1 /src
parent5ba329bf4324747ef3afe9638c202a6de7512724 (diff)
downloadhercules-ccc18ecfe671803c6d6b9b6dd790c45cdf28c9ac.tar.gz
hercules-ccc18ecfe671803c6d6b9b6dd790c45cdf28c9ac.tar.bz2
hercules-ccc18ecfe671803c6d6b9b6dd790c45cdf28c9ac.tar.xz
hercules-ccc18ecfe671803c6d6b9b6dd790c45cdf28c9ac.zip
- Cleaned some more the hotkey code: The order by and limit specifications are not really needed when loading hotkeys, and added hotkey deletion when you delete the character.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11022 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/char_sql/char.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 5ff26c0aa..8ec26f6a5 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -1107,7 +1107,7 @@ int mmo_char_fromsql(int char_id, struct mmo_charstatus* p, bool load_everything
#ifdef HOTKEY_SAVING
//Hotkeys
- sprintf(tmp_sql, "SELECT `hotkey`, `type`, `itemskill_id`, `skill_lvl` FROM `%s` WHERE `char_id`=%d ORDER BY `hotkey` LIMIT %d;", hotkey_db, char_id, HOTKEY_SAVING);
+ sprintf(tmp_sql, "SELECT `hotkey`, `type`, `itemskill_id`, `skill_lvl` FROM `%s` WHERE `char_id`='%d'", hotkey_db, char_id);
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);
@@ -1492,7 +1492,16 @@ int delete_char_sql(int char_id, int partner_id)
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
}
-
+
+#ifdef HOTKEY_SAVING
+ /* delete hotkeys */
+ sprintf(tmp_sql, "DELETE FROM `%s` WHERE `char_id`='%d'", hotkey_db, char_id);
+ 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);
+ }
+#endif
+
/* delete inventory */
sprintf(tmp_sql,"DELETE FROM `%s` WHERE `char_id`='%d'",inventory_db, char_id);
if(mysql_query(&mysql_handle, tmp_sql)) {