From 8e008eeaddef8c375adab103ddd30fd12470e195 Mon Sep 17 00:00:00 2001 From: shennetsind Date: Fri, 3 Aug 2012 03:46:16 +0000 Subject: Fixed bugreport:6401 / Follow up r16562 git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16565 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/unit.c | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) (limited to 'src/map') diff --git a/src/map/unit.c b/src/map/unit.c index e2735fdc8..339f0a988 100644 --- a/src/map/unit.c +++ b/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; } } -- cgit v1.2.3-70-g09d2