summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
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);
+ }
}
}