diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-08-21 22:44:29 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-08-21 22:45:15 +0300 |
commit | 42f47e483da19079a937c4801ca94bd62d8dc970 (patch) | |
tree | 56dc96737e01e04d54357ce7118de3a1f000c516 /src/gui/viewport.cpp | |
parent | 2d8b9246c8003f1d32ba396bc19cc11bc5a595b2 (diff) | |
download | manaverse-42f47e483da19079a937c4801ca94bd62d8dc970.tar.gz manaverse-42f47e483da19079a937c4801ca94bd62d8dc970.tar.bz2 manaverse-42f47e483da19079a937c4801ca94bd62d8dc970.tar.xz manaverse-42f47e483da19079a937c4801ca94bd62d8dc970.zip |
Remove useless else.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r-- | src/gui/viewport.cpp | 106 |
1 files changed, 52 insertions, 54 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index c77232591..168ec317a 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -441,71 +441,69 @@ bool Viewport::leftMouseAction() mHoverBeing->talkTo(); return true; } - else + + const ActorTypeT type = mHoverBeing->getType(); + switch (type) { - const ActorTypeT type = mHoverBeing->getType(); - switch (type) - { - case ActorType::Player: - validateSpeed(); - if (actorManager != nullptr) - { + case ActorType::Player: + validateSpeed(); + if (actorManager != nullptr) + { #ifdef TMWA_SUPPORT - if (localPlayer != mHoverBeing || mSelfMouseHeal) - actorManager->heal(mHoverBeing); + if (localPlayer != mHoverBeing || mSelfMouseHeal) + actorManager->heal(mHoverBeing); #endif // TMWA_SUPPORT - if (localPlayer == mHoverBeing && - mHoverItem != nullptr) - { - localPlayer->pickUp(mHoverItem); - } - return true; + if (localPlayer == mHoverBeing && + mHoverItem != nullptr) + { + localPlayer->pickUp(mHoverItem); } - break; - case ActorType::Monster: - case ActorType::Npc: - case ActorType::SkillUnit: - if (!stopAttack) + return true; + } + break; + case ActorType::Monster: + case ActorType::Npc: + case ActorType::SkillUnit: + if (!stopAttack) + { + if ((localPlayer->withinAttackRange(mHoverBeing) || + inputManager.isActionActive(InputAction::ATTACK))) { - if ((localPlayer->withinAttackRange(mHoverBeing) || - inputManager.isActionActive(InputAction::ATTACK))) + validateSpeed(); + if (!mStatsReUpdated && localPlayer != mHoverBeing) { - validateSpeed(); - if (!mStatsReUpdated && localPlayer != mHoverBeing) - { - localPlayer->attack(mHoverBeing, - !inputManager.isActionActive( - InputAction::STOP_ATTACK)); - return true; - } + localPlayer->attack(mHoverBeing, + !inputManager.isActionActive( + InputAction::STOP_ATTACK)); + return true; } - else if (!inputManager.isActionActive( - InputAction::ATTACK)) + } + else if (!inputManager.isActionActive( + InputAction::ATTACK)) + { + validateSpeed(); + if (!mStatsReUpdated && localPlayer != mHoverBeing) { - validateSpeed(); - if (!mStatsReUpdated && localPlayer != mHoverBeing) - { - localPlayer->setGotoTarget(mHoverBeing); - return true; - } + localPlayer->setGotoTarget(mHoverBeing); + return true; } } - break; - case ActorType::FloorItem: - case ActorType::Portal: - case ActorType::Pet: - case ActorType::Mercenary: - case ActorType::Homunculus: - case ActorType::Elemental: - break; - case ActorType::Unknown: - case ActorType::Avatar: - default: - reportAlways("Left click on unknown actor type: %d", - CAST_S32(type)); - break; - } + } + break; + case ActorType::FloorItem: + case ActorType::Portal: + case ActorType::Pet: + case ActorType::Mercenary: + case ActorType::Homunculus: + case ActorType::Elemental: + break; + case ActorType::Unknown: + case ActorType::Avatar: + default: + reportAlways("Left click on unknown actor type: %d", + CAST_S32(type)); + break; } } // Picks up a item if we clicked on one |