summaryrefslogtreecommitdiff
path: root/src/localplayer.h
diff options
context:
space:
mode:
authorYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2012-01-18 16:31:05 +0100
committerYohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer>2012-01-18 22:06:40 +0100
commite554d9b2be1ec2fcb15065ae70151302adeef602 (patch)
tree7ed91e2cc9ec4e2049d4438e0682d1b62ed7590f /src/localplayer.h
parentd706e45af52a25a2a0032d1161a3c4423a63eae2 (diff)
downloadmana-client-e554d9b2be1ec2fcb15065ae70151302adeef602.tar.gz
mana-client-e554d9b2be1ec2fcb15065ae70151302adeef602.tar.bz2
mana-client-e554d9b2be1ec2fcb15065ae70151302adeef602.tar.xz
mana-client-e554d9b2be1ec2fcb15065ae70151302adeef602.zip
Found a better way to fix the movement glitches on both servers.
The patch also takes care of not spamming the different servers, when the servers are setting the being speed correctly. The most problems were coming from the keyboard movement functions handling 1 tile paths. To void the issues seen in #405, #439, and #440, I simply prevented to set a new path before reaching the destination of the former one, when using the keyboard. The mouse path system remains unchanged. I also made some functions private (or here protected) to show they shouldn't be called by something else than the localplayer object. And I removed the nextTile() function, since it was obsolete, unused, and replaced by the nextTile(direction) function. That patch was tested on both servers with mouse/keyboard mixed use. Resolves: Mana-Mantis #405, #439, #440. Reviewed-by: bjorn
Diffstat (limited to 'src/localplayer.h')
-rw-r--r--src/localplayer.h51
1 files changed, 19 insertions, 32 deletions
diff --git a/src/localplayer.h b/src/localplayer.h
index e3849126..554312c8 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -79,23 +79,6 @@ class LocalPlayer : public Being
virtual void setAction(Action action, int attackId = 1);
/**
- * Compute the next pathnode location when walking using keyboard.
- * used by nextTile().
- */
- Position getNextWalkPosition(unsigned char dir);
-
- /**
- * Adds a new tile to the path when walking.
- * @note Eathena
- * Also, when specified, it picks up an item at the end of a path
- * or attack target.
- */
- virtual void nextTile()
- { nextTile(0); }
-
- virtual void nextTile(unsigned char dir);
-
- /**
* Check the player has permission to invite users to specific guild
*/
bool checkInviteRights(const std::string &guildName);
@@ -147,15 +130,14 @@ class LocalPlayer : public Being
*/
void setTarget(Being *target);
- void setMoveSpeed(const Vector &speed);
-
/**
* Sets a new destination for this being to walk to.
*/
virtual void setDestination(int x, int y);
/**
- * Sets a new direction to keep walking in.
+ * Sets a new direction to keep walking in, when using the keyboard
+ * or the joystick.
*/
void setWalkingDir(int dir);
@@ -175,11 +157,6 @@ class LocalPlayer : public Being
*/
bool withinAttackRange(Being *target);
- /**
- * Stops the player dead in his tracks
- */
- void stopWalking(bool sendToServer = true);
-
void toggleSit();
void emote(uint8_t emotion);
@@ -233,8 +210,25 @@ class LocalPlayer : public Being
/** Whether or not the name settings have changed */
bool mUpdateName;
+ /** Make the character starts to walk. */
void startWalking(unsigned char dir);
+ /**
+ * Stops the player dead in his tracks
+ */
+ void stopWalking(bool sendToServer = true);
+
+ /**
+ * set the next path tile when walking and using the keyboard.
+ */
+ virtual void nextTile(unsigned char dir);
+
+ /**
+ * Compute the next pathnode location when walking using keyboard.
+ * used by nextTile().
+ */
+ Position getNextWalkPosition(unsigned char dir);
+
int mAttackRange;
int mTargetTime; /** How long the being has been targeted **/
@@ -255,13 +249,6 @@ class LocalPlayer : public Being
int mLocalWalkTime; /**< Timestamp used to control keyboard walk
messages flooding */
- /**
- * The delay between two permitted setDestination() call using
- * the keyboard.
- * It's set in milliseconds per tile.
- */
- int mKeyboardMoveDelay;
-
typedef std::pair<std::string, int> MessagePair;
/** Queued messages*/
std::list<MessagePair> mMessages;