summaryrefslogtreecommitdiff
path: root/src/localplayer.cpp
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2009-10-29 11:20:29 +0100
committerBertram <bertram@cegetel.net>2009-10-29 11:20:29 +0100
commit6d2a6ee01523bbec105cd2e6ce9a24ab7c1094f2 (patch)
tree99bd2c18c08a034a5fcffe49dfa3d2ade43095b0 /src/localplayer.cpp
parent45223500f7a5f661adea71e57010b018bac2cf32 (diff)
downloadmana-6d2a6ee01523bbec105cd2e6ce9a24ab7c1094f2.tar.gz
mana-6d2a6ee01523bbec105cd2e6ce9a24ab7c1094f2.tar.bz2
mana-6d2a6ee01523bbec105cd2e6ce9a24ab7c1094f2.tar.xz
mana-6d2a6ee01523bbec105cd2e6ce9a24ab7c1094f2.zip
Second round of fine tuning for keyboard movement.
I just discovered that the X,Y offsets aren't handled the same way between eAthena and Manaserv to draw the player's character. So, this patch hopefully fix the walk on water bug. There are some glitches left: - Like walking diagonally to a blocked corner. - Or Some times the character miss a blocked tile and correct its route. - The character's name is drawn in the wrong place for Manaserv client. - The playerBox draws the player at the wrong location; He's not centered at login and isn't diplayed at all in equipment window... But anyway, it's better than before. I'll go on for some polishing before continuing. Some cleanups are becoming vital for code's understanding.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r--src/localplayer.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index a6e558e8..f17fbca4 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -303,7 +303,6 @@ void LocalPlayer::nextStep(unsigned char dir = 0)
const Vector &pos = getPosition();
// Compute where the next step will be set.
-
int dx = 0, dy = 0;
if (dir & UP)
dy--;
@@ -342,7 +341,7 @@ void LocalPlayer::nextStep(unsigned char dir = 0)
}
}
- if (dScaler > 0)
+ if (dScaler > 16)
{
//effectManager->trigger(15, (int) pos.x + (dx * dScaler), (int) pos.y + (dy * dScaler));
setDestination((int) pos.x + (dx * dScaler), (int) pos.y + (dy * dScaler));
@@ -526,13 +525,12 @@ void LocalPlayer::setDestination(Uint16 x, Uint16 y)
mDestX = x;
mDestY = y;
+ Being::setDestination(x, y);
Net::getPlayerHandler()->setDestination(x, y, mDirection);
}
mPickUpTarget = NULL;
mKeepAttacking = false;
-
- Being::setDestination(x, y);
}
void LocalPlayer::setWalkingDir(int dir)