diff options
author | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-29 20:20:51 +0200 |
---|---|---|
committer | Yohann Ferreira <yohann_dot_ferreira_at_orange_dot_efer> | 2010-07-29 20:20:51 +0200 |
commit | ae898aa1a5175b2b08f7248e4cd89bf61bc8e4be (patch) | |
tree | 041646a78229772ae7bb55222659fc4826325c43 /src/localplayer.cpp | |
parent | 2b1c0dcf269d617de1f6c203df547166661f089e (diff) | |
download | mana-client-ae898aa1a5175b2b08f7248e4cd89bf61bc8e4be.tar.gz mana-client-ae898aa1a5175b2b08f7248e4cd89bf61bc8e4be.tar.bz2 mana-client-ae898aa1a5175b2b08f7248e4cd89bf61bc8e4be.tar.xz mana-client-ae898aa1a5175b2b08f7248e4cd89bf61bc8e4be.zip |
Changed the items loading to handle a new 'attack-action' parameter.
The old behaviour was to load the weapon-type value and do many
unnecessary checks and transformation on it:
The weapon-type was transformed using hard-coded values into
an integer enum value.
The exact same thing was done on the opposite side in the animation
files before comparing the two.
As both data were string values, I simplified all of it by using
the value taken in items.xml to call the corresponding action.
This now also permit to set up new attack animation in items.xml
and in the playerset.xml without having the need
to modify the client code.
Last but not least, the weapon-type value was used by both the skills
and the actions and avoided the possibility to set up a definite action
for a weapon-type.
Note: The weapon-type parameter will become deprecated for the server
in favor of a 'skill' parameter to reflect more it's actual use.
This patch is the first step to fix Manasource issue: #157.
Diffstat (limited to 'src/localplayer.cpp')
-rw-r--r-- | src/localplayer.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/localplayer.cpp b/src/localplayer.cpp index 339ba42e..97694b7c 100644 --- a/src/localplayer.cpp +++ b/src/localplayer.cpp @@ -776,11 +776,11 @@ void LocalPlayer::setWalkingDir(int dir) mWalkingDir = dir; // If we're not already walking, start walking. - if (mAction != WALK && dir) + if (mAction != MOVE && dir) { startWalking(dir); } - else if (mAction == WALK && (Net::getNetworkType() == ServerInfo::MANASERV)) + else if (mAction == MOVE && (Net::getNetworkType() == ServerInfo::MANASERV)) { nextTile(dir); } @@ -793,7 +793,7 @@ void LocalPlayer::startWalking(unsigned char dir) if (!mMap || !dir) return; - if (mAction == WALK && !mPath.empty()) + if (mAction == MOVE && !mPath.empty()) { // Just finish the current action, otherwise we get out of sync if (Net::getNetworkType() == ServerInfo::MANASERV) @@ -848,7 +848,7 @@ void LocalPlayer::startWalking(unsigned char dir) void LocalPlayer::stopWalking(bool sendToServer) { - if (mAction == WALK && mWalkingDir) + if (mAction == MOVE && mWalkingDir) { mWalkingDir = 0; mLocalWalkTime = 0; |