diff options
author | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-04-22 20:54:57 +0000 |
---|---|---|
committer | Eugenio Favalli <elvenprogrammer@gmail.com> | 2005-04-22 20:54:57 +0000 |
commit | af947fb9a6fa85d403a9c041a8b46079a96072fa (patch) | |
tree | b1e182fb773d8ebf966d704bfd7464df515520e0 /src/game.cpp | |
parent | 50788ab3e58235878d77962247a082c8c81ca38a (diff) | |
download | mana-af947fb9a6fa85d403a9c041a8b46079a96072fa.tar.gz mana-af947fb9a6fa85d403a9c041a8b46079a96072fa.tar.bz2 mana-af947fb9a6fa85d403a9c041a8b46079a96072fa.tar.xz mana-af947fb9a6fa85d403a9c041a8b46079a96072fa.zip |
now player faces the right direction when attacking with right mouse button
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/game.cpp b/src/game.cpp index 1afa5e79..79f9a013 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -358,6 +358,14 @@ void do_input() } else if (target->isMonster()) { if (player_node->action == STAND) { + if (my > player_node->y) + player_node->direction = SOUTH; + else if (my < player_node->y) + player_node->direction = NORTH; + else if (mx > player_node->x) + player_node->direction = EAST; + else if (mx < player_node->x) + player_node->direction = WEST; player_node->action = ATTACK; action(0, target->id); player_node->walk_time = tick_time; |