summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2010-01-25 23:54:38 +0100
committerBertram <bertram@cegetel.net>2010-01-25 23:54:38 +0100
commite5423740f34a6c5be1df36c84e7ce5ea84bfda1e (patch)
tree9d74cfe4df04edc56c7b434a6895109090472615 /src/gui
parent79245e6be83e5b2a92177fc98f256791cdc1e09a (diff)
downloadmana-e5423740f34a6c5be1df36c84e7ce5ea84bfda1e.tar.gz
mana-e5423740f34a6c5be1df36c84e7ce5ea84bfda1e.tar.bz2
mana-e5423740f34a6c5be1df36c84e7ce5ea84bfda1e.tar.xz
mana-e5423740f34a6c5be1df36c84e7ce5ea84bfda1e.zip
Finished Freeyorp's ViewPort bug fixing commit:
http://gitorious.org/mana/mana/commit/58149dca937410826971f99b72e304121e61abb7 by merging ViewPort::mLocalWalkTime and ::mLocalWalktime into the first one, removing ifdefs, and making sure the setDestination() calls aren't done each ticks by setting the mLocalWalkTime equal to player->mWalkTime while Mouse Left Dragging, I also set it back to -1 when stop walking to avoid the bug where you have to start walking using the keyboard before being able to walk dragging the mouse under eAthena.
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/viewport.cpp10
-rw-r--r--src/gui/viewport.h5
2 files changed, 6 insertions, 9 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index db995ab0..b3ed03f1 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -55,11 +55,7 @@ Viewport::Viewport():
mShowDebugPath(false),
mVisibleNames(false),
mPlayerFollowMouse(false),
-#ifdef MANASERV_SUPPORT
mLocalWalkTime(-1)
-#else
- mWalkTime(-1)
-#endif
{
setOpaque(false);
addMouseListener(this);
@@ -424,8 +420,9 @@ void Viewport::mouseDragged(gcn::MouseEvent &event)
player_node->pathSetByMouse();
}
#else
- if (mWalkTime != player_node->mWalkTime)
+ if (mLocalWalkTime != player_node->mWalkTime)
{
+ mLocalWalkTime = player_node->mWalkTime;
int destX = event.getX() / 32 + mTileViewX;
int destY = event.getY() / 32 + mTileViewY;
player_node->setDestination(destX, destY);
@@ -437,6 +434,9 @@ void Viewport::mouseDragged(gcn::MouseEvent &event)
void Viewport::mouseReleased(gcn::MouseEvent &event)
{
mPlayerFollowMouse = false;
+#ifdef EATHENA_SUPPORT
+ mLocalWalkTime = -1;
+#endif
}
void Viewport::showPopup(int x, int y, Item *item, bool isInventory)
diff --git a/src/gui/viewport.h b/src/gui/viewport.h
index d3a86f1d..4b12bcc6 100644
--- a/src/gui/viewport.h
+++ b/src/gui/viewport.h
@@ -177,11 +177,8 @@ class Viewport : public WindowContainer, public gcn::MouseListener,
bool mVisibleNames; /**< Show target names. */
bool mPlayerFollowMouse;
-#ifdef MANASERV_SUPPORT
+
int mLocalWalkTime; /**< Timestamp before the next walk can be sent. */
-#else
- int mWalkTime;
-#endif
PopupMenu *mPopupMenu; /**< Popup menu. */
Being *mSelectedBeing; /**< Current selected being. */