diff options
author | David Athay <ko2fan@gmail.com> | 2008-07-24 15:06:10 +0000 |
---|---|---|
committer | David Athay <ko2fan@gmail.com> | 2008-07-24 15:06:10 +0000 |
commit | 2eb6a5a2c1c9ddfc86aabed037abb6fe696f4b8c (patch) | |
tree | 7949fc66bbba1cdb73ec7426a156d2fed94887f3 /src/game-server/movingobject.cpp | |
parent | 26d4751d4d382bfcfb7196e355f85d584c335a6c (diff) | |
download | manaserv-2eb6a5a2c1c9ddfc86aabed037abb6fe696f4b8c.tar.gz manaserv-2eb6a5a2c1c9ddfc86aabed037abb6fe696f4b8c.tar.bz2 manaserv-2eb6a5a2c1c9ddfc86aabed037abb6fe696f4b8c.tar.xz manaserv-2eb6a5a2c1c9ddfc86aabed037abb6fe696f4b8c.zip |
Added error message when NPC is too far away.
Diffstat (limited to 'src/game-server/movingobject.cpp')
-rw-r--r-- | src/game-server/movingobject.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/game-server/movingobject.cpp b/src/game-server/movingobject.cpp index 70334341..68f93b5a 100644 --- a/src/game-server/movingobject.cpp +++ b/src/game-server/movingobject.cpp @@ -131,6 +131,7 @@ void MovingObject::move() { PATH_NODE next = mPath.front(); mPath.pop_front(); + // 362 / 256 is square root of 2, used for walking diagonally mActionTime += (prev.x != next.x && prev.y != next.y) ? mSpeed * 362 / 256 : mSpeed; if (mPath.empty()) @@ -139,6 +140,7 @@ void MovingObject::move() pos = mDst; break; } + // position the object in the middle of the tile for pathfinding purposes pos.x = next.x * 32 + 16; pos.y = next.y * 32 + 16; } |