diff options
author | xantara <xantara@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-23 05:13:59 +0000 |
---|---|---|
committer | xantara <xantara@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-01-23 05:13:59 +0000 |
commit | e8f32370d3ce62dd46af7a21ecfb49f83a404aea (patch) | |
tree | 429bae5464ba5cbabeabf52091c1853564692f7c /src/char/int_mercenary.c | |
parent | 8756ba5d50270bbad6ad7065a05a1329ef86878b (diff) | |
download | hercules-e8f32370d3ce62dd46af7a21ecfb49f83a404aea.tar.gz hercules-e8f32370d3ce62dd46af7a21ecfb49f83a404aea.tar.bz2 hercules-e8f32370d3ce62dd46af7a21ecfb49f83a404aea.tar.xz hercules-e8f32370d3ce62dd46af7a21ecfb49f83a404aea.zip |
` Added renaming support for the remaining 'ragnarok' tables in the inter_athena.conf file - bugreport:3317
-- Includes: homunculus, skill_homunculus, mercenary, mercenary_owner, ragsrvinfo
` Fixed a typo regarding the homunculus_db
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15508 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char/int_mercenary.c')
-rw-r--r-- | src/char/int_mercenary.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/char/int_mercenary.c b/src/char/int_mercenary.c index 1b11878b8..3b3714416 100644 --- a/src/char/int_mercenary.c +++ b/src/char/int_mercenary.c @@ -19,7 +19,7 @@ bool mercenary_owner_fromsql(int char_id, struct mmo_charstatus *status) { char* data; - if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `merc_id`, `arch_calls`, `arch_faith`, `spear_calls`, `spear_faith`, `sword_calls`, `sword_faith` FROM `mercenary_owner` WHERE `char_id` = '%d'", char_id) ) + if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `merc_id`, `arch_calls`, `arch_faith`, `spear_calls`, `spear_faith`, `sword_calls`, `sword_faith` FROM `%s` WHERE `char_id` = '%d'", mercenary_owner_db, char_id) ) { Sql_ShowDebug(sql_handle); return false; @@ -45,8 +45,8 @@ bool mercenary_owner_fromsql(int char_id, struct mmo_charstatus *status) bool mercenary_owner_tosql(int char_id, struct mmo_charstatus *status) { - if( SQL_ERROR == Sql_Query(sql_handle, "REPLACE INTO `mercenary_owner` (`char_id`, `merc_id`, `arch_calls`, `arch_faith`, `spear_calls`, `spear_faith`, `sword_calls`, `sword_faith`) VALUES ('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')", - char_id, status->mer_id, status->arch_calls, status->arch_faith, status->spear_calls, status->spear_faith, status->sword_calls, status->sword_faith) ) + if( SQL_ERROR == Sql_Query(sql_handle, "REPLACE INTO `%s` (`char_id`, `merc_id`, `arch_calls`, `arch_faith`, `spear_calls`, `spear_faith`, `sword_calls`, `sword_faith`) VALUES ('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')", + mercenary_owner_db, char_id, status->mer_id, status->arch_calls, status->arch_faith, status->spear_calls, status->spear_faith, status->sword_calls, status->sword_faith) ) { Sql_ShowDebug(sql_handle); return false; @@ -57,10 +57,10 @@ bool mercenary_owner_tosql(int char_id, struct mmo_charstatus *status) bool mercenary_owner_delete(int char_id) { - if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `mercenary_owner` WHERE `char_id` = '%d'", char_id) ) + if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `char_id` = '%d'", mercenary_owner_db, char_id) ) Sql_ShowDebug(sql_handle); - if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `mercenary` WHERE `char_id` = '%d'", char_id) ) + if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `char_id` = '%d'", mercenary_db, char_id) ) Sql_ShowDebug(sql_handle); return true; @@ -73,8 +73,8 @@ bool mapif_mercenary_save(struct s_mercenary* merc) if( merc->mercenary_id == 0 ) { // Create new DB entry if( SQL_ERROR == Sql_Query(sql_handle, - "INSERT INTO `mercenary` (`char_id`,`class`,`hp`,`sp`,`kill_counter`,`life_time`) VALUES ('%d','%d','%d','%d','%u','%u')", - merc->char_id, merc->class_, merc->hp, merc->sp, merc->kill_count, merc->life_time) ) + "INSERT INTO `%s` (`char_id`,`class`,`hp`,`sp`,`kill_counter`,`life_time`) VALUES ('%d','%d','%d','%d','%u','%u')", + mercenary_db, merc->char_id, merc->class_, merc->hp, merc->sp, merc->kill_count, merc->life_time) ) { Sql_ShowDebug(sql_handle); flag = false; @@ -83,8 +83,8 @@ bool mapif_mercenary_save(struct s_mercenary* merc) merc->mercenary_id = (int)Sql_LastInsertId(sql_handle); } else if( SQL_ERROR == Sql_Query(sql_handle, - "UPDATE `mercenary` SET `char_id` = '%d', `class` = '%d', `hp` = '%d', `sp` = '%d', `kill_counter` = '%u', `life_time` = '%u' WHERE `mer_id` = '%d'", - merc->char_id, merc->class_, merc->hp, merc->sp, merc->kill_count, merc->life_time, merc->mercenary_id) ) + "UPDATE `%s` SET `char_id` = '%d', `class` = '%d', `hp` = '%d', `sp` = '%d', `kill_counter` = '%u', `life_time` = '%u' WHERE `mer_id` = '%d'", + mercenary_db, merc->char_id, merc->class_, merc->hp, merc->sp, merc->kill_count, merc->life_time, merc->mercenary_id) ) { // Update DB entry Sql_ShowDebug(sql_handle); flag = false; @@ -101,7 +101,7 @@ bool mapif_mercenary_load(int merc_id, int char_id, struct s_mercenary *merc) merc->mercenary_id = merc_id; merc->char_id = char_id; - if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `class`, `hp`, `sp`, `kill_counter`, `life_time` FROM `mercenary` WHERE `mer_id` = '%d' AND `char_id` = '%d'", merc_id, char_id) ) + if( SQL_ERROR == Sql_Query(sql_handle, "SELECT `class`, `hp`, `sp`, `kill_counter`, `life_time` FROM `%s` WHERE `mer_id` = '%d' AND `char_id` = '%d'", mercenary_db, merc_id, char_id) ) { Sql_ShowDebug(sql_handle); return false; @@ -127,7 +127,7 @@ bool mapif_mercenary_load(int merc_id, int char_id, struct s_mercenary *merc) bool mapif_mercenary_delete(int merc_id) { - if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `mercenary` WHERE `mer_id` = '%d'", merc_id) ) + if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `mer_id` = '%d'", mercenary_db, merc_id) ) { Sql_ShowDebug(sql_handle); return false; |