Kaynağa Gözat

Fixed bugreport:6401 / Follow up r16562

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@16565 54d463be-8e91-2dee-dedb-b68131a5f0ec
shennetsind 12 yıl önce
ebeveyn
işleme
cef909df2f
1 değiştirilmiş dosya ile 16 ekleme ve 26 silme
  1. 16 26
      src/map/unit.c

+ 16 - 26
src/map/unit.c

@@ -686,8 +686,7 @@ uint8 unit_getdir(struct block_list *bl)
 //  &1  Do not send position update packets.
 int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag)
 {
-	if(count)
-	{
+	if(count) {
 		struct map_session_data* sd;
 		struct skill_unit* su = NULL;
 		int nx, ny, result;
@@ -700,49 +699,40 @@ int unit_blown(struct block_list* bl, int dx, int dy, int count, int flag)
 		nx = result>>16;
 		ny = result&0xffff;
 
-		if(!su)
-		{
+		if(!su) {
 			unit_stop_walking(bl, 0);
 		}
-
-		sd->ud.to_x = nx;
-		sd->ud.to_y = ny;
-
+	
+		if( sd ) {
+			sd->ud.to_x = nx;
+			sd->ud.to_y = ny;
+		}
+		
 		dx = nx-bl->x;
 		dy = ny-bl->y;
 
-		if(dx || dy)
-		{
+		if(dx || dy) {
 			map_foreachinmovearea(clif_outsight, bl, AREA_SIZE, dx, dy, bl->type == BL_PC ? BL_ALL : BL_PC, bl);
 
-			if(su)
-			{
+			if(su) {
 				skill_unit_move_unit_group(su->group, bl->m, dx, dy);
-			}
-			else
-			{
+			} else {
 				map_moveblock(bl, nx, ny, gettick());
 			}
 
 			map_foreachinmovearea(clif_insight, bl, AREA_SIZE, -dx, -dy, bl->type == BL_PC ? BL_ALL : BL_PC, bl);
 
-			if(!(flag&1))
-			{
+			if(!(flag&1)) {
 				clif_blown(bl);
 			}
 
-			if(sd)
-			{
-				if(sd->touching_id)
-				{
+			if(sd) {
+				if(sd->touching_id) {
 					npc_touchnext_areanpc(sd, false);
 				}
-				if(map_getcell(bl->m, bl->x, bl->y, CELL_CHKNPC))
-				{
+				if(map_getcell(bl->m, bl->x, bl->y, CELL_CHKNPC)) {
 					npc_touch_areanpc(sd, bl->m, bl->x, bl->y);
-				}
-				else
-				{
+				} else {
 					sd->areanpc_id = 0;
 				}
 			}