summaryrefslogtreecommitdiff
path: root/src/map/unit.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-03 03:46:16 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-03 03:46:16 +0000
commit8e008eeaddef8c375adab103ddd30fd12470e195 (patch)
tree87427af90bd88bec1de927e3b47ef7ad9b476490 /src/map/unit.c
parent0c5b0d92695599474b377c1c5c743682498b5786 (diff)
downloadhercules-8e008eeaddef8c375adab103ddd30fd12470e195.tar.gz
hercules-8e008eeaddef8c375adab103ddd30fd12470e195.tar.bz2
hercules-8e008eeaddef8c375adab103ddd30fd12470e195.tar.xz
hercules-8e008eeaddef8c375adab103ddd30fd12470e195.zip
Fixed bugreport:6401 / Follow up r16562
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16565 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/unit.c')
-rw-r--r--src/map/unit.c42
1 files changed, 16 insertions, 26 deletions
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;
}
}