summaryrefslogtreecommitdiff
path: root/src/gui/viewport.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-05-31 00:19:18 +0300
committerAndrei Karas <akaras@inbox.ru>2015-05-31 00:19:18 +0300
commit694e07d193e7c5758a7d672b45668651b034003d (patch)
tree20a4aec8dee2b3b5475db9f3667e797fb43c603b /src/gui/viewport.cpp
parentc9a84749b3b71d4df6cc3b9b488d60dc4a013a20 (diff)
downloadmv-694e07d193e7c5758a7d672b45668651b034003d.tar.gz
mv-694e07d193e7c5758a7d672b45668651b034003d.tar.bz2
mv-694e07d193e7c5758a7d672b45668651b034003d.tar.xz
mv-694e07d193e7c5758a7d672b45668651b034003d.zip
Convert InputAction enum into strong typed enum.
Diffstat (limited to 'src/gui/viewport.cpp')
-rw-r--r--src/gui/viewport.cpp16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp
index 78b66b930..5c0c7328c 100644
--- a/src/gui/viewport.cpp
+++ b/src/gui/viewport.cpp
@@ -455,20 +455,18 @@ bool Viewport::leftMouseAction()
type == ActorType::Npc))
{
if ((localPlayer->withinAttackRange(mHoverBeing) ||
- inputManager.isActionActive(static_cast<int>(
- InputAction::ATTACK))))
+ inputManager.isActionActive(InputAction::ATTACK)))
{
validateSpeed();
if (!mStatsReUpdated && localPlayer != mHoverBeing)
{
localPlayer->attack(mHoverBeing,
!inputManager.isActionActive(
- static_cast<int>(InputAction::STOP_ATTACK)));
+ InputAction::STOP_ATTACK));
return true;
}
}
- else if (!inputManager.isActionActive(static_cast<int>(
- InputAction::ATTACK)))
+ else if (!inputManager.isActionActive(InputAction::ATTACK))
{
validateSpeed();
if (!mStatsReUpdated && localPlayer != mHoverBeing)
@@ -498,8 +496,7 @@ bool Viewport::leftMouseAction()
return true;
}
// Just walk around
- else if (!inputManager.isActionActive(static_cast<int>(
- InputAction::ATTACK)))
+ else if (!inputManager.isActionActive(InputAction::ATTACK))
{
validateSpeed();
localPlayer->stopAttack();
@@ -964,9 +961,8 @@ void Viewport::returnCamera()
void Viewport::validateSpeed()
{
- if (!inputManager.isActionActive(static_cast<int>(
- InputAction::TARGET_ATTACK)) && !inputManager.isActionActive(
- static_cast<int>(InputAction::ATTACK)))
+ if (!inputManager.isActionActive(InputAction::TARGET_ATTACK) &&
+ !inputManager.isActionActive(InputAction::ATTACK))
{
if (Game::instance())
Game::instance()->setValidSpeed();