From 08c870656aeb76d839a8ad2fd071818b8618f899 Mon Sep 17 00:00:00 2001 From: zephyrus Date: Sun, 31 Aug 2008 22:56:05 +0000 Subject: - A proper mercenary lifetime calculation. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13165 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char_sql/int_homun.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/char_sql/int_homun.c') diff --git a/src/char_sql/int_homun.c b/src/char_sql/int_homun.c index 17633ef4a..77753f04a 100644 --- a/src/char_sql/int_homun.c +++ b/src/char_sql/int_homun.c @@ -303,7 +303,7 @@ bool mapif_mercenary_save(struct s_mercenary* merc) { // 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->remain_life_time) ) + merc->char_id, merc->class_, merc->hp, merc->sp, merc->kill_count, merc->life_time) ) { Sql_ShowDebug(sql_handle); flag = false; @@ -313,7 +313,7 @@ bool mapif_mercenary_save(struct s_mercenary* merc) } 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->remain_life_time, merc->mercenary_id) ) + 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; @@ -346,7 +346,7 @@ bool mapif_mercenary_load(int merc_id, int char_id, struct s_mercenary *merc) Sql_GetData(sql_handle, 1, &data, NULL); merc->hp = atoi(data); Sql_GetData(sql_handle, 2, &data, NULL); merc->sp = atoi(data); Sql_GetData(sql_handle, 3, &data, NULL); merc->kill_count = atoi(data); - Sql_GetData(sql_handle, 4, &data, NULL); merc->remain_life_time = atoi(data); + Sql_GetData(sql_handle, 4, &data, NULL); merc->life_time = atoi(data); Sql_FreeResult(sql_handle); if( save_log ) ShowInfo("Mercenary loaded (%d - %d).\n", merc->mercenary_id, merc->char_id); -- cgit v1.2.3-60-g2f50