From a087ad9e45ac64f2ae6258f729a68bcc224fe305 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Sat, 12 Sep 2020 13:15:54 -0300 Subject: This is Hercules v2019.10.20 --- src/map/guild.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/map/guild.c') diff --git a/src/map/guild.c b/src/map/guild.c index 2faf60e2b..dbfe03d3e 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -152,7 +152,8 @@ static bool guild_read_castledb_libconfig(void) { struct config_t castle_conf; struct config_setting_t *castle_db = NULL, *it = NULL; - const char *config_filename = "db/castle_db.conf"; // FIXME hardcoded name + char config_filename[256]; + libconfig->format_db_path("castle_db.conf", config_filename, sizeof(config_filename)); int i = 0; if (libconfig->load_file(&castle_conf, config_filename) == 0) @@ -565,6 +566,7 @@ static int guild_check_member(const struct guild *g) if (i == INDEX_NOT_FOUND) { sd->status.guild_id=0; sd->guild_emblem_id=0; + sd->guild = NULL; ShowWarning("guild: check_member %d[%s] is not member\n",sd->status.account_id,sd->status.name); } } @@ -581,8 +583,11 @@ static int guild_recv_noinfo(int guild_id) iter = mapit_getallusers(); for (sd = BL_UCAST(BL_PC, mapit->first(iter)); mapit->exists(iter); sd = BL_UCAST(BL_PC, mapit->next(iter))) { - if( sd->status.guild_id == guild_id ) + if (sd->status.guild_id == guild_id) { sd->status.guild_id = 0; // erase guild + sd->guild_emblem_id = 0; + sd->guild = NULL; + } } mapit->free(iter); @@ -872,6 +877,8 @@ static void guild_member_joined(struct map_session_data *sd) i = guild->getindex(g, sd->status.account_id, sd->status.char_id); if (i == INDEX_NOT_FOUND) { sd->status.guild_id = 0; + sd->guild_emblem_id = 0; + sd->guild = NULL; } else { g->member[i].sd = sd; sd->guild = g; -- cgit v1.2.3-70-g09d2