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.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 157d9e28a..b39ae1c59 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -4791,6 +4791,14 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
stop = true;
}
}
+ /* we hit a instance, if empty we populate the spawn data */
+ if( map->list[m].instance_id >= 0 && instance->list[map->list[m].instance_id].respawn.map == 0 &&
+ instance->list[map->list[m].instance_id].respawn.x == 0 &&
+ instance->list[map->list[m].instance_id].respawn.y == 0) {
+ instance->list[map->list[m].instance_id].respawn.map = mapindex;
+ instance->list[map->list[m].instance_id].respawn.x = x;
+ instance->list[map->list[m].instance_id].respawn.y = y;
+ }
}
sd->state.changemap = (sd->mapindex != mapindex);