diff options
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; } |