summaryrefslogtreecommitdiff
path: root/src/map/pet.c
diff options
context:
space:
mode:
authorPiotr HaƂaczkiewicz <piotr.halaczkiewicz@gmail.com>2013-07-23 09:56:54 +0200
committerPiotr HaƂaczkiewicz <piotr.halaczkiewicz@gmail.com>2013-07-23 18:04:17 +0200
commit78028c8b652a4edf761b6f250c2fca4b6c576dee (patch)
treecfe66856a33bfe12f9ce9dbfee16ab18128364e5 /src/map/pet.c
parent056c181e1c163b7d49c87bc07bf82ef11fdbd539 (diff)
downloadhercules-78028c8b652a4edf761b6f250c2fca4b6c576dee.tar.gz
hercules-78028c8b652a4edf761b6f250c2fca4b6c576dee.tar.bz2
hercules-78028c8b652a4edf761b6f250c2fca4b6c576dee.tar.xz
hercules-78028c8b652a4edf761b6f250c2fca4b6c576dee.zip
Pathfinding code cleanup.
Now uses binary heap defined in `db.h`. Walk requests now use A* (hard) pathfinding only to match game client behavior. Added defines for movement cost. Added some documentation & comments.
Diffstat (limited to 'src/map/pet.c')
-rw-r--r--src/map/pet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/pet.c b/src/map/pet.c
index 2697e8128..3e7019806 100644
--- a/src/map/pet.c
+++ b/src/map/pet.c
@@ -817,7 +817,7 @@ static int pet_randomwalk(struct pet_data *pd,unsigned int tick)
}
for(i=c=0;i<pd->ud.walkpath.path_len;i++){
if(pd->ud.walkpath.path[i]&1)
- c+=pd->status.speed*14/10;
+ c+=pd->status.speed*MOVE_DIAGONAL_COST/MOVE_COST;
else
c+=pd->status.speed;
}