From 6d2a6ee01523bbec105cd2e6ce9a24ab7c1094f2 Mon Sep 17 00:00:00 2001 From: Bertram Date: Thu, 29 Oct 2009 11:20:29 +0100 Subject: 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. --- src/net/manaserv/beinghandler.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'src/net') diff --git a/src/net/manaserv/beinghandler.cpp b/src/net/manaserv/beinghandler.cpp index 3df346a4..d8508f01 100644 --- a/src/net/manaserv/beinghandler.cpp +++ b/src/net/manaserv/beinghandler.cpp @@ -313,12 +313,18 @@ void BeingHandler::handleBeingDirChangeMessage(MessageIn &msg) if (!being) return; int data = msg.readInt8(); - switch (data) + + // The direction for the player's character is handled on client side. + if (being != player_node) { - case DIRECTION_UP: being->setDirection(Being::UP); break; - case DIRECTION_DOWN: being->setDirection(Being::DOWN); break; - case DIRECTION_LEFT: being->setDirection(Being::LEFT); break; - case DIRECTION_RIGHT: being->setDirection(Being::RIGHT); break; + switch (data) + { + case DIRECTION_UP: being->setDirection(Being::UP); break; + case DIRECTION_DOWN: being->setDirection(Being::DOWN); break; + case DIRECTION_LEFT: being->setDirection(Being::LEFT); break; + case DIRECTION_RIGHT: being->setDirection(Being::RIGHT); break; + default: break; + } } } -- cgit v1.2.3-60-g2f50