diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-09-18 23:07:40 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-09-18 23:07:40 +0300 |
commit | dc6568962a32ddb6f231c629e7ad3373e9086b6c (patch) | |
tree | 744e9f2507c6113e1ba941a11b16e4923aa00858 /src | |
parent | 6419386c4c382753509425826ee609dd07d4ae72 (diff) | |
download | manaverse-dc6568962a32ddb6f231c629e7ad3373e9086b6c.tar.gz manaverse-dc6568962a32ddb6f231c629e7ad3373e9086b6c.tar.bz2 manaverse-dc6568962a32ddb6f231c629e7ad3373e9086b6c.tar.xz manaverse-dc6568962a32ddb6f231c629e7ad3373e9086b6c.zip |
remove useless conditions.
Diffstat (limited to 'src')
-rw-r--r-- | src/actorspritemanager.cpp | 4 | ||||
-rw-r--r-- | src/being/being.cpp | 4 | ||||
-rw-r--r-- | src/being/localplayer.cpp | 12 | ||||
-rw-r--r-- | src/gui/inventorywindow.cpp | 2 | ||||
-rw-r--r-- | src/gui/logindialog.cpp | 1 |
5 files changed, 11 insertions, 12 deletions
diff --git a/src/actorspritemanager.cpp b/src/actorspritemanager.cpp index 3c23bccbe..597355af5 100644 --- a/src/actorspritemanager.cpp +++ b/src/actorspritemanager.cpp @@ -1050,12 +1050,12 @@ Being *ActorSpriteManager::findNearestLivingBeing(const Being *const // logger->log("index:" + toString(index)); // logger->log("d:" + toString(d)); - if (valid && !filtered && (d <= dist || !closestBeing)) + if (!filtered && (d <= dist || !closestBeing)) { dist = d; closestBeing = being; } - else if (valid && filtered) + else if (filtered) { int w2 = defaultPriorityIndex; if (closestBeing) diff --git a/src/being/being.cpp b/src/being/being.cpp index 3f40398a0..645a71dac 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -1062,7 +1062,7 @@ std::string Being::getWeaponAttackAction(const ItemInfo *const weapon) const if (!weapon) return SpriteAction::ATTACK; - if (serverVersion < 0 || !weapon) + if (serverVersion < 0) { return weapon->getAttackAction(); } @@ -1085,7 +1085,7 @@ std::string Being::getAttackAction(const Attack *const attack1) const if (!attack1) return SpriteAction::ATTACK; - if (serverVersion < 0 || !attack1) + if (serverVersion < 0) { return attack1->mAction; } diff --git a/src/being/localplayer.cpp b/src/being/localplayer.cpp index 04bb2603a..f78dd7329 100644 --- a/src/being/localplayer.cpp +++ b/src/being/localplayer.cpp @@ -990,7 +990,7 @@ void LocalPlayer::setDestination(const int x, const int y) Net::getPlayerHandler()->setDestination(x, y, mDirection); Being::setDestination(x, y); } - else if (mInvertDirection == 1) + else { uint8_t newDir = 0; if (mDirection & UP) @@ -1011,9 +1011,7 @@ void LocalPlayer::setDestination(const int x, const int y) } Being::setDestination(x, y); - } - else - { + #ifdef MANASERV_SUPPORT // Manaserv: // If the destination given to being class is accepted, @@ -1244,7 +1242,7 @@ void LocalPlayer::attack(Being *const target, const bool keep, if (!target || target->getType() == ActorSprite::NPC) return; - if (mTarget != target || !mTarget) + if (mTarget != target) setTarget(target); #ifdef MANASERV_SUPPORT @@ -3349,7 +3347,7 @@ void LocalPlayer::setHome() } else { - if (specialLayer && iter != mHomes.end()) + if (iter != mHomes.end()) { specialLayer->setTile(static_cast<int>(pos.x), static_cast<int>(pos.y), MapItem::EMPTY); @@ -3817,7 +3815,7 @@ void LocalPlayer::attack2(Being *const target, const bool keep, return; } setTarget(target); - if (target && target->getType() != Being::NPC) + if (target->getType() != Being::NPC) { mKeepAttacking = true; moveToTarget(); diff --git a/src/gui/inventorywindow.cpp b/src/gui/inventorywindow.cpp index e497f5782..a1c4287c8 100644 --- a/src/gui/inventorywindow.cpp +++ b/src/gui/inventorywindow.cpp @@ -661,7 +661,7 @@ void InventoryWindow::updateButtons(const Item *item) if (mUseButton) { - if (item && item->isEquipment()) + if (item->isEquipment()) { if (item->isEquipped()) { diff --git a/src/gui/logindialog.cpp b/src/gui/logindialog.cpp index 3481dddc7..c872b54a5 100644 --- a/src/gui/logindialog.cpp +++ b/src/gui/logindialog.cpp @@ -54,6 +54,7 @@ std::string LoginDialog::savedPasswordKey(""); struct OpenUrlListener : public gcn::ActionListener { OpenUrlListener() : + gcn::ActionListener(), url() { } |