summaryrefslogtreecommitdiff
path: root/src/map/pc.c
diff options
context:
space:
mode:
authorzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-20 17:56:01 +0000
committerzephyrus <zephyrus@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-06-20 17:56:01 +0000
commitef7452b497d24f6f475d214f1244ab589b304c7c (patch)
treec24bedb42ecf633efada0475417d7f0592d2e1ab /src/map/pc.c
parent6f700c626efe9253ce77865667d1d5e598daab65 (diff)
downloadhercules-ef7452b497d24f6f475d214f1244ab589b304c7c.tar.gz
hercules-ef7452b497d24f6f475d214f1244ab589b304c7c.tar.bz2
hercules-ef7452b497d24f6f475d214f1244ab589b304c7c.tar.xz
hercules-ef7452b497d24f6f475d214f1244ab589b304c7c.zip
- Instancing System (Thanks to Sirius White who did most of the code, with some of my work to implement client side information, some optimizations and bugfixes). Also thanks to contributions from UEAUP team and Orcao.
- Fixed a bug on areamobuseskill and changed it to make it as Aegis. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13901 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r--src/map/pc.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/map/pc.c b/src/map/pc.c
index 21173b673..3c596ec13 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -3826,6 +3826,20 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
pc_setrestartvalue(sd,1);
}
+ m = map_mapindex2mapid(mapindex);
+ if( map[m].instance_map[0] && map[m].instance_id == 0 )
+ { // Source Instance Map
+ int im = map_instance_map2imap(m, sd, 0);
+ if( im <= 0 )
+ {
+ ShowError("pc_setpos: player %s trying to enter instance map '%s' without instanced copy.\n", sd->status.name, map[m].name);
+ return 2; // map not found
+ }
+
+ m = im;
+ mapindex = map_id2index(m);
+ }
+
sd->state.changemap = (sd->mapindex != mapindex);
if( sd->state.changemap )
{ // Misc map-changing settings
@@ -3862,8 +3876,8 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
sd->regen.state.gc = 0;
}
- m=map_mapindex2mapid(mapindex);
- if(m<0) {
+ if( m < 0 )
+ {
uint32 ip;
uint16 port;
//if can't find any map-servers, just abort setting position.