summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 99198fa50..321e386ae 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -37,6 +37,7 @@
#include "char/int_quest.h"
#include "char/int_rodex.h"
#include "char/int_storage.h"
+#include "char/int_achievement.h"
#include "char/inter.h"
#include "char/loginif.h"
#include "char/mapif.h"
@@ -112,6 +113,7 @@ char acc_reg_num_db[32] = "acc_reg_num_db";
char acc_reg_str_db[32] = "acc_reg_str_db";
char char_reg_str_db[32] = "char_reg_str_db";
char char_reg_num_db[32] = "char_reg_num_db";
+char char_achievement_db[256] = "char_achievements";
static struct char_interface char_s;
struct char_interface *chr;
@@ -291,12 +293,18 @@ static void char_set_char_offline(int char_id, int account_id)
}
else
{
- struct mmo_charstatus* cp = (struct mmo_charstatus*) idb_get(chr->char_db_,char_id);
+ struct mmo_charstatus *cp = (struct mmo_charstatus*) idb_get(chr->char_db_, char_id);
+ /* Character Achievements */
+ struct char_achievements *c_ach = (struct char_achievements *) idb_get(inter_achievement->char_achievements, char_id);
inter_guild->CharOffline(char_id, cp?cp->guild_id:-1);
- if (cp)
+ if (cp != NULL)
idb_remove(chr->char_db_,char_id);
+ if (c_ach != NULL) {
+ VECTOR_CLEAR(*c_ach);
+ idb_remove(inter_achievement->char_achievements, char_id);
+ }
if( SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `online`='0' WHERE `char_id`='%d' LIMIT 1", char_db, char_id) )
Sql_ShowDebug(inter->sql_handle);
@@ -5443,6 +5451,7 @@ static bool char_sql_config_read_pc(const char *filename, const struct config_t
libconfig->setting_lookup_mutable_string(setting, "hotkey_db", hotkey_db, sizeof(hotkey_db));
libconfig->setting_lookup_mutable_string(setting, "scdata_db", scdata_db, sizeof(scdata_db));
libconfig->setting_lookup_mutable_string(setting, "inventory_db", inventory_db, sizeof(inventory_db));
+ libconfig->setting_lookup_mutable_string(setting, "achievement_db", char_achievement_db, sizeof(char_achievement_db));
libconfig->setting_lookup_mutable_string(setting, "cart_db", cart_db, sizeof(cart_db));
libconfig->setting_lookup_mutable_string(setting, "charlog_db", charlog_db, sizeof(charlog_db));
libconfig->setting_lookup_mutable_string(setting, "storage_db", storage_db, sizeof(storage_db));
@@ -6319,6 +6328,7 @@ void char_load_defaults(void)
inter_quest_defaults();
inter_storage_defaults();
inter_rodex_defaults();
+ inter_achievement_defaults();
inter_defaults();
geoip_defaults();
}