diff options
author | Piotr HaĆaczkiewicz <piotr.halaczkiewicz@gmail.com> | 2013-07-23 09:56:54 +0200 |
---|---|---|
committer | Piotr HaĆaczkiewicz <piotr.halaczkiewicz@gmail.com> | 2013-07-23 18:04:17 +0200 |
commit | 78028c8b652a4edf761b6f250c2fca4b6c576dee (patch) | |
tree | cfe66856a33bfe12f9ce9dbfee16ab18128364e5 /src/map/pet.c | |
parent | 056c181e1c163b7d49c87bc07bf82ef11fdbd539 (diff) | |
download | hercules-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.c | 2 |
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; } |