diff options
author | Andrei Karas <akaras@inbox.ru> | 2010-01-09 01:20:56 +0200 |
---|---|---|
committer | Blue <bluesansdouze@gmail.com> | 2010-01-09 00:31:09 +0100 |
commit | a9da8dca359f1975d1be6bbef16ea72928652880 (patch) | |
tree | 68dd6904db2de6924450109c555f664f45327011 /src/game.cpp | |
parent | b5643b417e12308163802c3a11ac28f1abd239f9 (diff) | |
download | mana-a9da8dca359f1975d1be6bbef16ea72928652880.tar.gz mana-a9da8dca359f1975d1be6bbef16ea72928652880.tar.bz2 mana-a9da8dca359f1975d1be6bbef16ea72928652880.tar.xz mana-a9da8dca359f1975d1be6bbef16ea72928652880.zip |
Allow change player direction by emote key+arrow keys
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/game.cpp b/src/game.cpp index b04d1990..fc374025 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -76,6 +76,7 @@ #include "net/gamehandler.h" #include "net/generalhandler.h" +#include "net/playerhandler.h" #include "net/net.h" #include "resources/imagewriter.h" @@ -947,7 +948,19 @@ void Game::handleInput() direction |= Being::RIGHT; } - player_node->setWalkingDir(direction); + if (keyboard.isKeyActive(keyboard.KEY_EMOTE) && direction != 0) + { + if (player_node->getDirection() != direction) + { + player_node->setDirection(direction); + Net::getPlayerHandler()->setDirection(direction); + } + direction = 0; + } + else + { + player_node->setWalkingDir(direction); + } // Attacking monsters if (keyboard.isKeyActive(keyboard.KEY_ATTACK) || |