summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-11-16 17:46:23 +0100
committerGitHub <noreply@github.com>2018-11-16 17:46:23 +0100
commit283d34b2e821097badee727564396d94c266aa96 (patch)
treec18c7ecd98d311e81d20b9cfc844af90c8ef9b8d /src/map/pc.c
parent1db2ef52d603e9944a912fcf350706a7a44202c9 (diff)
parent61016983c4eb29dc4a76050fa8920c6bcdc0a1fd (diff)
downloadhercules-283d34b2e821097badee727564396d94c266aa96.tar.gz
hercules-283d34b2e821097badee727564396d94c266aa96.tar.bz2
hercules-283d34b2e821097badee727564396d94c266aa96.tar.xz
hercules-283d34b2e821097badee727564396d94c266aa96.zip
Merge pull request #2322 from MishimaHaruna/fix-allychat-leaveguild
Fix allychat leaveguild
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 78b773550..fcd36a233 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -1329,6 +1329,7 @@ static bool pc_authok(struct map_session_data *sd, int login_id2, time_t expirat
sd->bg_queue.client_has_bg_data = 0;
sd->bg_queue.type = 0;
+ VECTOR_INIT(sd->channels);
VECTOR_INIT(sd->script_queues);
VECTOR_INIT(sd->achievement); // Achievements [Smokexyz/Hercules]
VECTOR_INIT(sd->storage.item); // initialize storage item vector.
@@ -5837,8 +5838,11 @@ static int pc_setpos(struct map_session_data *sd, unsigned short map_index, int
vending->close(sd);
}
- if (map->list[sd->bl.m].channel) {
- channel->leave(map->list[sd->bl.m].channel,sd);
+ if (sd->mapindex != 0) {
+ // Only if the character is already on a map
+ if (map->list[sd->bl.m].channel) {
+ channel->leave(map->list[sd->bl.m].channel,sd);
+ }
}
}