diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-07-27 21:56:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-07-27 21:56:44 +0300 |
commit | 7f7625e913fd1d131feef4f816c90c33e79316d1 (patch) | |
tree | ec5a647b07188f4f3f9005313dfa2856b04d9882 /src/being/being.cpp | |
parent | 5f61b3a8ec592bc251a08366656b55bdfe3736a0 (diff) | |
download | plus-7f7625e913fd1d131feef4f816c90c33e79316d1.tar.gz plus-7f7625e913fd1d131feef4f816c90c33e79316d1.tar.bz2 plus-7f7625e913fd1d131feef4f816c90c33e79316d1.tar.xz plus-7f7625e913fd1d131feef4f816c90c33e79316d1.zip |
Remove some evol server checks.
Diffstat (limited to 'src/being/being.cpp')
-rw-r--r-- | src/being/being.cpp | 90 |
1 files changed, 31 insertions, 59 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp index 487749a0d..1523c10a0 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1032,45 +1032,31 @@ void Being::fireMissile(Being *const victim, const std::string &particle) const std::string Being::getSitAction() const { - if (serverVersion < 0) + if (mMap) { - return SpriteAction::SIT; - } - else - { - if (mMap) - { - const unsigned char mask = mMap->getBlockMask(mX, mY); - if (mask & BlockMask::GROUNDTOP) - return SpriteAction::SITTOP; - else if (mask & BlockMask::AIR) - return SpriteAction::SITSKY; - else if (mask & BlockMask::WATER) - return SpriteAction::SITWATER; - } - return SpriteAction::SIT; + const unsigned char mask = mMap->getBlockMask(mX, mY); + if (mask & BlockMask::GROUNDTOP) + return SpriteAction::SITTOP; + else if (mask & BlockMask::AIR) + return SpriteAction::SITSKY; + else if (mask & BlockMask::WATER) + return SpriteAction::SITWATER; } + return SpriteAction::SIT; } std::string Being::getMoveAction() const { - if (serverVersion < 0) - { - return SpriteAction::MOVE; - } - else + if (mMap) { - if (mMap) - { - const unsigned char mask = mMap->getBlockMask(mX, mY); - if (mask & BlockMask::AIR) - return SpriteAction::FLY; - else if (mask & BlockMask::WATER) - return SpriteAction::SWIM; - } - return SpriteAction::MOVE; + const unsigned char mask = mMap->getBlockMask(mX, mY); + if (mask & BlockMask::AIR) + return SpriteAction::FLY; + else if (mask & BlockMask::WATER) + return SpriteAction::SWIM; } + return SpriteAction::MOVE; } std::string Being::getWeaponAttackAction(const ItemInfo *const weapon) const @@ -1101,43 +1087,29 @@ std::string Being::getAttackAction(const Attack *const attack1) const if (!attack1) return SpriteAction::ATTACK; - if (serverVersion < 0) + if (mMap) { - return attack1->mAction; - } - else - { - if (mMap) - { - const unsigned char mask = mMap->getBlockMask(mX, mY); - if (mask & BlockMask::AIR) - return attack1->mSkyAction; - else if (mask & BlockMask::WATER) - return attack1->mWaterAction; - } - return attack1->mAction; + const unsigned char mask = mMap->getBlockMask(mX, mY); + if (mask & BlockMask::AIR) + return attack1->mSkyAction; + else if (mask & BlockMask::WATER) + return attack1->mWaterAction; } + return attack1->mAction; } #define getSpriteAction(func, action) \ std::string Being::get##func##Action() const \ { \ - if (serverVersion < 0) \ - { \ - return SpriteAction::action; \ - } \ - else \ + if (mMap) \ { \ - if (mMap) \ - { \ - const unsigned char mask = mMap->getBlockMask(mX, mY); \ - if (mask & BlockMask::AIR) \ - return SpriteAction::action##SKY; \ - else if (mask & BlockMask::WATER) \ - return SpriteAction::action##WATER; \ - } \ - return SpriteAction::action; \ + const unsigned char mask = mMap->getBlockMask(mX, mY); \ + if (mask & BlockMask::AIR) \ + return SpriteAction::action##SKY; \ + else if (mask & BlockMask::WATER) \ + return SpriteAction::action##WATER; \ } \ + return SpriteAction::action; \ } getSpriteAction(Dead, DEAD) @@ -3028,7 +3000,7 @@ void Being::setEmote(const uint8_t emotion, const int emote_time) void Being::updatePercentHP() { - if (!mMaxHP || !serverVersion) + if (!mMaxHP) return; if (mHP) { |