summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBertram <bertram@cegetel.net>2010-02-23 18:47:19 +0100
committerBertram <bertram@cegetel.net>2010-02-23 18:47:19 +0100
commit21d785397e58aa6c62e2e19353d61df73e69a5a0 (patch)
treecb1ef5f2697e23b48a3930f1e117bce54b10bad8 /src
parent4ce429b7f949524b5392d91cf480c933882d15d9 (diff)
downloadMana-21d785397e58aa6c62e2e19353d61df73e69a5a0.tar.gz
Mana-21d785397e58aa6c62e2e19353d61df73e69a5a0.tar.bz2
Mana-21d785397e58aa6c62e2e19353d61df73e69a5a0.tar.xz
Mana-21d785397e58aa6c62e2e19353d61df73e69a5a0.zip
Got rid of superfluous Destination coordinates in LocalPlayer.
This will help simplifying setDestination() calls. No regression seen in both client.
Diffstat (limited to 'src')
-rw-r--r--src/being.h7
-rw-r--r--src/localplayer.cpp6
-rw-r--r--src/localplayer.h2
3 files changed, 5 insertions, 10 deletions
diff --git a/src/being.h b/src/being.h
index 58fe4c77..3b63b02d 100644
--- a/src/being.h
+++ b/src/being.h
@@ -645,6 +645,8 @@ class Being : public Sprite, public ConfigListener
ParticleVector mStatusParticleEffects;
ParticleList mChildParticleEffects;
+ Vector mDest; /**< destination coordinates. */
+
private:
/**
@@ -668,9 +670,8 @@ class Being : public Sprite, public ConfigListener
*/
Vector mWalkSpeed;
- Vector mPos;
- Vector mDest;
- int mX, mY; /**< Position on tile */
+ Vector mPos; /**< Position coordinates. */
+ int mX, mY; /**< Position in tile */
int mDamageTaken;
diff --git a/src/localplayer.cpp b/src/localplayer.cpp
index 8133bf4a..6f63d799 100644
--- a/src/localplayer.cpp
+++ b/src/localplayer.cpp
@@ -98,7 +98,6 @@ LocalPlayer::LocalPlayer(int id, int job):
mLastAction(-1),
mWalkingDir(0),
mPathSetByMouse(false),
- mDestX(0), mDestY(0),
mInventory(new Inventory(Net::getInventoryHandler()
->getSize(Net::InventoryHandler::INVENTORY))),
mLocalWalkTime(-1),
@@ -516,11 +515,8 @@ void LocalPlayer::setDestination(int x, int y)
}
// Only send a new message to the server when destination changes
- if (x != mDestX || y != mDestY)
+ if (x != mDest.x || y != mDest.y)
{
- mDestX = x;
- mDestY = y;
-
Being::setDestination(x, y);
Net::getPlayerHandler()->setDestination(x, y, mDirection);
}
diff --git a/src/localplayer.h b/src/localplayer.h
index c9f6c5b5..6279d546 100644
--- a/src/localplayer.h
+++ b/src/localplayer.h
@@ -474,8 +474,6 @@ class LocalPlayer : public Player
int mLastAction; /**< Time stamp of the last action, -1 if none. */
int mWalkingDir; /**< The direction the player is walking in. */
bool mPathSetByMouse; /**< Tells if the path was set using mouse */
- int mDestX; /**< X coordinate of destination. */
- int mDestY; /**< Y coordinate of destination. */
std::vector<int> mStatusEffectIcons;