diff options
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 55 |
1 files changed, 29 insertions, 26 deletions
diff --git a/src/game.cpp b/src/game.cpp index c0abdf543..bf944a710 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -1146,47 +1146,50 @@ void Game::handleInput() setValidSpeed(); player_node->cancelFollow(); } - else if (keyboard.isKeyActive(keyboard.KEY_DIRECT_UP)) + else if (!keyboard.isKeyActive(keyboard.KEY_EMOTE)) { - if (player_node->getDirection() != Being::UP) + if (keyboard.isKeyActive(keyboard.KEY_DIRECT_UP)) { - if (Client::limitPackets(PACKET_DIRECTION)) + if (player_node->getDirection() != Being::UP) { - player_node->setDirection(Being::UP); - Net::getPlayerHandler()->setDirection(Being::UP); + if (Client::limitPackets(PACKET_DIRECTION)) + { + player_node->setDirection(Being::UP); + Net::getPlayerHandler()->setDirection(Being::UP); + } } } - } - else if (keyboard.isKeyActive(keyboard.KEY_DIRECT_DOWN)) - { - if (player_node->getDirection() != Being::DOWN) + else if (keyboard.isKeyActive(keyboard.KEY_DIRECT_DOWN)) { - if (Client::limitPackets(PACKET_DIRECTION)) + if (player_node->getDirection() != Being::DOWN) { - player_node->setDirection(Being::DOWN); - Net::getPlayerHandler()->setDirection(Being::DOWN); + if (Client::limitPackets(PACKET_DIRECTION)) + { + player_node->setDirection(Being::DOWN); + Net::getPlayerHandler()->setDirection(Being::DOWN); + } } } - } - else if (keyboard.isKeyActive(keyboard.KEY_DIRECT_LEFT)) - { - if (player_node->getDirection() != Being::LEFT) + else if (keyboard.isKeyActive(keyboard.KEY_DIRECT_LEFT)) { - if (Client::limitPackets(PACKET_DIRECTION)) + if (player_node->getDirection() != Being::LEFT) { - player_node->setDirection(Being::LEFT); - Net::getPlayerHandler()->setDirection(Being::LEFT); + if (Client::limitPackets(PACKET_DIRECTION)) + { + player_node->setDirection(Being::LEFT); + Net::getPlayerHandler()->setDirection(Being::LEFT); + } } } - } - else if (keyboard.isKeyActive(keyboard.KEY_DIRECT_RIGHT)) - { - if (player_node->getDirection() != Being::RIGHT) + else if (keyboard.isKeyActive(keyboard.KEY_DIRECT_RIGHT)) { - if (Client::limitPackets(PACKET_DIRECTION)) + if (player_node->getDirection() != Being::RIGHT) { - player_node->setDirection(Being::RIGHT); - Net::getPlayerHandler()->setDirection(Being::RIGHT); + if (Client::limitPackets(PACKET_DIRECTION)) + { + player_node->setDirection(Being::RIGHT); + Net::getPlayerHandler()->setDirection(Being::RIGHT); + } } } } |