summaryrefslogtreecommitdiff
path: root/src/being.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/being.cpp
parent45223500f7a5f661adea71e57010b018bac2cf32 (diff)
downloadmana-client-6d2a6ee01523bbec105cd2e6ce9a24ab7c1094f2.tar.gz
mana-client-6d2a6ee01523bbec105cd2e6ce9a24ab7c1094f2.tar.bz2
mana-client-6d2a6ee01523bbec105cd2e6ce9a24ab7c1094f2.tar.xz
mana-client-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/being.cpp')
-rw-r--r--src/being.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/being.cpp b/src/being.cpp
index feec617a..be98bfdd 100644
--- a/src/being.cpp
+++ b/src/being.cpp
@@ -539,7 +539,6 @@ void Being::logic()
// When we've not reached our destination, move to it.
if (nominalLength > 1.0f && mWalkSpeed > 0.0f)
{
-
// The private mWalkSpeed member is the speed in tiles per second.
// We translate it into pixels per tick,
// because the logic is called every ticks.
@@ -583,6 +582,7 @@ void Being::logic()
direction |= (dir.x > 0) ? RIGHT : LEFT;
else
direction |= (dir.y > 0) ? DOWN : UP;
+
setDirection(direction);
}
else if (!mPath.empty())
@@ -611,11 +611,11 @@ void Being::logic()
// Update sprite animations
if (mUsedTargetCursor)
- mUsedTargetCursor->update(tick_time * 10);
+ mUsedTargetCursor->update(tick_time * MILLISECONDS_IN_A_TICK);
for (SpriteIterator it = mSprites.begin(); it != mSprites.end(); it++)
if (*it)
- (*it)->update(tick_time * 10);
+ (*it)->update(tick_time * MILLISECONDS_IN_A_TICK);
// Restart status/particle effects, if needed
if (mMustResetParticles) {
@@ -636,9 +636,13 @@ void Being::draw(Graphics *graphics, int offsetX, int offsetY) const
{
// TODO: Eventually, we probably should fix all sprite offsets so that
// these translations aren't necessary anymore. The sprites know
- // best where their centerpoint should be.
+ // best where their base point should be.
const int px = mPx + offsetX - 16;
+#ifdef MANASERV_SUPPORT
+ const int py = mPy + offsetY - 15; // Temporary fix to the Y offset.
+#else
const int py = mPy + offsetY - 32;
+#endif
if (mUsedTargetCursor)
mUsedTargetCursor->draw(graphics, px, py);