summaryrefslogtreecommitdiff
path: root/src/map
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-10-19 17:30:35 +0200
committerGitHub <noreply@github.com>2019-10-19 17:30:35 +0200
commit574e63d3e04e6b1cdb2d9d19fa164263ba5d5bf7 (patch)
tree18a7f8a353831055385aa9edc149719d20305a09 /src/map
parenta7f67d0513cc6f55056a37d2f6ae55bcf58af174 (diff)
parent36cb0a2410671bc940b6cdb0e6ff0716deb24175 (diff)
downloadhercules-574e63d3e04e6b1cdb2d9d19fa164263ba5d5bf7.tar.gz
hercules-574e63d3e04e6b1cdb2d9d19fa164263ba5d5bf7.tar.bz2
hercules-574e63d3e04e6b1cdb2d9d19fa164263ba5d5bf7.tar.xz
hercules-574e63d3e04e6b1cdb2d9d19fa164263ba5d5bf7.zip
Merge pull request #2562 from MishimaHaruna/cached-info-fixes
Clean up cached party/guild data when leaving/disbanding
Diffstat (limited to 'src/map')
-rw-r--r--src/map/guild.c8
-rw-r--r--src/map/party.c1
2 files changed, 8 insertions, 1 deletions
diff --git a/src/map/guild.c b/src/map/guild.c
index 2faf60e2b..3b611bb05 100644
--- a/src/map/guild.c
+++ b/src/map/guild.c
@@ -565,6 +565,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 +582,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 +876,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;
diff --git a/src/map/party.c b/src/map/party.c
index 9fbe915f3..35ffe5636 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -695,6 +695,7 @@ static int party_broken(int party_id)
if( p->data[i].sd!=NULL ) {
clif->party_withdraw(p,p->data[i].sd,p->party.member[i].account_id,p->party.member[i].name,0x10);
p->data[i].sd->status.party_id=0;
+ clif->charnameupdate(p->data[i].sd);
}
}