summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2018-11-13 18:27:06 +0100
committerHaru <haru@dotalux.com>2018-11-13 18:27:06 +0100
commit61016983c4eb29dc4a76050fa8920c6bcdc0a1fd (patch)
treeddc37a4f72a1c4484b81941224b52bfbec13d391 /src/map/pc.c
parent7c0e13d5eb5385d00f775e692ecc36f7d089615f (diff)
downloadhercules-61016983c4eb29dc4a76050fa8920c6bcdc0a1fd.tar.gz
hercules-61016983c4eb29dc4a76050fa8920c6bcdc0a1fd.tar.bz2
hercules-61016983c4eb29dc4a76050fa8920c6bcdc0a1fd.tar.xz
hercules-61016983c4eb29dc4a76050fa8920c6bcdc0a1fd.zip
Fixed code that assumed the character to be already on a map, on login
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 282eb7112..9fa97a729 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -5839,8 +5839,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);
+ }
}
}