summaryrefslogtreecommitdiff
path: root/src/map/mob.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/mob.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/mob.c')
-rw-r--r--src/map/mob.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 601ecd110..9cd05a8a3 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -1364,7 +1364,7 @@ int mob_randomwalk(struct mob_data *md,unsigned int tick)
speed=iStatus->get_speed(&md->bl);
for(i=c=0;i<md->ud.walkpath.path_len;i++){ // The next walk start time is calculated.
if(md->ud.walkpath.path[i]&1)
- c+=speed*14/10;
+ c+=speed*MOVE_DIAGONAL_COST/MOVE_COST;
else
c+=speed;
}