diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/being.cpp | 12 | ||||
-rw-r--r-- | src/gui/viewport.cpp | 10 | ||||
-rw-r--r-- | src/localplayer.cpp | 4 |
3 files changed, 10 insertions, 16 deletions
diff --git a/src/being.cpp b/src/being.cpp index 32a3b5c3..a1bb7f92 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -168,16 +168,16 @@ void Being::setDestination(int dstX, int dstY) // Interpolate the offsets. Also convert from tile based to pixel based // Find the starting offset - int startX = (srcX % 32); - int startY = (srcY % 32); + float startX = (srcX % 32); + float startY = (srcY % 32); // Find the ending offset - int endX = (dstX % 32); - int endY = (dstY % 32); + float endX = (dstX % 32); + float endY = (dstY % 32); // Find the distance, and divide it by the number of steps - int changeX = (endX - startX) / thisPath.size(); - int changeY = (endY - startY) / thisPath.size(); + int changeX = (int)((endX - startX) / thisPath.size()); + int changeY = (int)((endY - startY) / thisPath.size()); // Convert the map path to pixels over tiles // And add interpolation between the starting and ending offsets diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index 9a631581..a2ae684a 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -233,21 +233,15 @@ void Viewport::logic() if (!mMap || !player_node) return; +#ifdef EATHENA_SUPPORT if (mPlayerFollowMouse && button & SDL_BUTTON(1) && -#ifdef TMWSERV_SUPPORT - get_elapsed_time(mLocalWalkTime) >= walkingMouseDelay) - { - mLocalWalkTime = tick_time; - player_node->setDestination(mMouseX + (int) mPixelViewX, - mMouseY + (int) mPixelViewY); -#else mWalkTime != player_node->mWalkTime) { player_node->setDestination(mMouseX / 32 + mTileViewX, mMouseY / 32 + mTileViewY); mWalkTime = player_node->mWalkTime; -#endif } +#endif } void Viewport::drawDebugPath(Graphics *graphics) diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 9b8e4a4b..7cd6b889 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -418,9 +418,9 @@ void LocalPlayer::walk(unsigned char dir) int dScaler; // Distance to walk - // Checks our path up to 1 tiles, if a blocking tile is found + // Checks our path up to 2 tiles, if a blocking tile is found // We go to the last good tile, and break out of the loop - for (dScaler = 1; dScaler <= 32; dScaler++) + for (dScaler = 1; dScaler <= 32 * 2; dScaler++) { if ( (dx || dy) && !mMap->getWalk( ((int) pos.x + (dx * dScaler)) / 32, |