summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 668929dfc..967edbab9 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2189,25 +2189,25 @@ int map_calc_dir(struct block_list* src, int x, int y)
}
else if( dx >= 0 && dy >=0 )
{ // upper-right
- if( dx*2-1 < dy ) dir = 0; // up
+ if( dx*2 <= dy ) dir = 0; // up
else if( dx > dy*2 ) dir = 6; // right
else dir = 7; // up-right
}
else if( dx >= 0 && dy <= 0 )
{ // lower-right
- if( dx*2-1 < -dy ) dir = 4; // down
+ if( dx*2 <= -dy ) dir = 4; // down
else if( dx > -dy*2 ) dir = 6; // right
else dir = 5; // down-right
}
else if( dx <= 0 && dy <= 0 )
{ // lower-left
- if( dx*2+1 > dy ) dir = 4; // down
+ if( dx*2 >= dy ) dir = 4; // down
else if( dx < dy*2 ) dir = 2; // left
else dir = 3; // down-left
}
else
{ // upper-left
- if( -dx*2-1 < dy ) dir = 0; // up
+ if( -dx*2 <= dy ) dir = 0; // up
else if( -dx > dy*2 ) dir = 2; // left
else dir = 1; // up-left