diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-06-06 14:49:47 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-06-06 14:49:47 +0300 |
commit | c649cf883480071c9b93909c4ea4ee5ec98155b2 (patch) | |
tree | 71022fd2db59c643c19c78c5524ffcd038e35a7f /src/actionmanager.cpp | |
parent | 4cab6fc78e19799f223d951d5ccc9afb303b65f2 (diff) | |
download | plus-c649cf883480071c9b93909c4ea4ee5ec98155b2.tar.gz plus-c649cf883480071c9b93909c4ea4ee5ec98155b2.tar.bz2 plus-c649cf883480071c9b93909c4ea4ee5ec98155b2.tar.xz plus-c649cf883480071c9b93909c4ea4ee5ec98155b2.zip |
Remove some duplicate code.
Diffstat (limited to 'src/actionmanager.cpp')
-rw-r--r-- | src/actionmanager.cpp | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/src/actionmanager.cpp b/src/actionmanager.cpp index 10b51cb41..5c0bf85fd 100644 --- a/src/actionmanager.cpp +++ b/src/actionmanager.cpp @@ -663,14 +663,19 @@ impHandler0(pickup) return false; } +static void doSit() +{ + if (inputManager.isActionActive(InputAction::EMOTE)) + player_node->updateSit(); + else + player_node->toggleSit(); +} + impHandler0(sit) { if (player_node) { - if (inputManager.isActionActive(InputAction::EMOTE)) - player_node->updateSit(); - else - player_node->toggleSit(); + doSit(); return true; } return false; @@ -1147,10 +1152,8 @@ impHandler0(stopSit) return false; if (!player_node->getTarget()) { - if (inputManager.isActionActive(InputAction::EMOTE)) - player_node->updateSit(); - else - player_node->toggleSit(); + doSit(); + return true; } return true; } |