diff options
author | Jared Adams <jaxad0127@gmail.com> | 2009-06-08 09:28:50 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2009-06-08 09:28:50 -0600 |
commit | 8596b1a8102726de0d7b3df12dff86f5c974e6fe (patch) | |
tree | e4403af689615f6fe8625beb679538780ecfba67 /src/being.cpp | |
parent | c9f52e60ea7eadca0d11fc0bbf7eb8a6ad465925 (diff) | |
download | mana-8596b1a8102726de0d7b3df12dff86f5c974e6fe.tar.gz mana-8596b1a8102726de0d7b3df12dff86f5c974e6fe.tar.bz2 mana-8596b1a8102726de0d7b3df12dff86f5c974e6fe.tar.xz mana-8596b1a8102726de0d7b3df12dff86f5c974e6fe.zip |
Merge being direction handling code
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 26 |
1 files changed, 2 insertions, 24 deletions
diff --git a/src/being.cpp b/src/being.cpp index 3c77cd2a..657e2236 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -76,9 +76,7 @@ Being::Being(int id, int job, Map *map): mJob(job), mId(id), mDirection(DOWN), -#ifdef TMWSERV_SUPPORT mSpriteDirection(DIRECTION_DOWN), -#endif mMap(NULL), mParticleEffects(config.getValue("particleeffects", 1)), mEquippedWeapon(NULL), @@ -461,12 +459,12 @@ void Being::setDirection(Uint8 direction) if (mDirection == direction) return; -#ifdef TMWSERV_SUPPORT + mDirection = direction; + // if the direction does not change much, keep the common component int mFaceDirection = mDirection & direction; if (!mFaceDirection) mFaceDirection = direction; - mDirection = direction; SpriteDirection dir; if (mFaceDirection & UP) @@ -478,10 +476,6 @@ void Being::setDirection(Uint8 direction) else dir = DIRECTION_LEFT; mSpriteDirection = dir; -#else - mDirection = direction; - SpriteDirection dir = getSpriteDirection(); -#endif for (int i = 0; i < VECTOREND_SPRITE; i++) { @@ -491,22 +485,6 @@ void Being::setDirection(Uint8 direction) } #ifdef EATHENA_SUPPORT -SpriteDirection Being::getSpriteDirection() const -{ - SpriteDirection dir; - - if (mDirection & UP) - dir = DIRECTION_UP; - else if (mDirection & DOWN) - dir = DIRECTION_DOWN; - else if (mDirection & RIGHT) - dir = DIRECTION_RIGHT; - else - dir = DIRECTION_LEFT; - - return dir; -} - void Being::nextStep() { if (mPath.empty()) |