summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authortoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-17 22:38:25 +0000
committertoms <toms@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-08-17 22:38:25 +0000
commit43e00cf6174ca30c6c702b59b5a1434dd1c5ce33 (patch)
tree86335f884d5f471f880753fa99cd4c7e6b8fbed6 /src/map/map.c
parent73c59399d732b6d5c88ccbf4fcb9ced38e777aca (diff)
downloadhercules-43e00cf6174ca30c6c702b59b5a1434dd1c5ce33.tar.gz
hercules-43e00cf6174ca30c6c702b59b5a1434dd1c5ce33.tar.bz2
hercules-43e00cf6174ca30c6c702b59b5a1434dd1c5ce33.tar.xz
hercules-43e00cf6174ca30c6c702b59b5a1434dd1c5ce33.zip
- Corrected map_random_dir algorithm
- Fixed homunc natural heal and little code cleanup git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@8327 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/map.c b/src/map/map.c
index abcd26440..422d1f3a9 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -2170,7 +2170,7 @@ int map_random_dir(struct block_list *bl, short *x, short *y) {
do {
j = rand()%8; //Pick a random direction
- segment = rand()%dist; //Pick a random interval from the whole vector in that direction
+ segment = 1+(rand()%dist); //Pick a random interval from the whole vector in that direction
xi = bl->x + segment*dirx[j];
segment = (short)sqrt(dist2 - segment*segment); //The complement of the previously picked segment
yi = bl->y + segment*diry[j];