diff options
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; |