浏览代码

Fixed a mistake in r12223, where during warping between mapservers, a character's coordinates would get changed before removing the character from the map, producing an infinite loop if the character returned back to the original coordinates. (bugreport:1286)

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@12442 54d463be-8e91-2dee-dedb-b68131a5f0ec
ultramage 17 年之前
父节点
当前提交
ac90e8170e
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/map/pc.c

+ 2 - 1
src/map/pc.c

@@ -3586,11 +3586,12 @@ int pc_setpos(struct map_session_data* sd, unsigned short mapindex, int x, int y
 		if(!sd->mapindex || map_mapname2ipport(mapindex,&ip,&port))
 			return 2;
 
+		//remove from map, THEN change x/y coordinates
+		unit_remove_map_pc(sd,clrtype);
 		sd->mapindex = mapindex;
 		sd->bl.x=x;
 		sd->bl.y=y;
 		pc_clean_skilltree(sd);
-		unit_remove_map_pc(sd,clrtype);
 		chrif_save(sd,2);
 		chrif_changemapserver(sd, ip, (short)port);
 		//It is important to invoke remove_map separately from unit_free before