diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-03-10 23:17:38 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-03-10 23:17:38 +0000 |
commit | dbd66d7d64361e76e3e366d919001a5b7ecd77c9 (patch) | |
tree | fa3c29fa5ffc8a978b64ddc385cd283ae4c9906e /src/game.cpp | |
parent | 627d4d27d594fb7356c3d4e9f4cb45eff77c1e48 (diff) | |
download | mana-dbd66d7d64361e76e3e366d919001a5b7ecd77c9.tar.gz mana-dbd66d7d64361e76e3e366d919001a5b7ecd77c9.tar.bz2 mana-dbd66d7d64361e76e3e366d919001a5b7ecd77c9.tar.xz mana-dbd66d7d64361e76e3e366d919001a5b7ecd77c9.zip |
Experimental mouse walk command and fixed one instability issue.
Diffstat (limited to 'src/game.cpp')
-rw-r--r-- | src/game.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/game.cpp b/src/game.cpp index 416e1a92..cb6d3615 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -330,13 +330,14 @@ void do_input() if (event.type == SDL_MOUSEBUTTONDOWN) { + int mx = event.button.x / 32 + camera_x; + int my = event.button.y / 32 + camera_y; + if (event.button.button == 3) { // We click the right button // NPC Call - int npc_x = event.button.x / 32 + camera_x; - int npc_y = event.button.y / 32 + camera_y; - int id = find_npc(npc_x, npc_y); + int id = find_npc(mx, my); if (id != 0) { // Check if no conflicting npc window is open @@ -350,6 +351,11 @@ void do_input() } } } + else if (event.button.button == 1) + { + // Experimental mouse walk command + walk(mx, my, 0); + } } // Push input to GUI when not used @@ -454,7 +460,6 @@ int get_packet_length(short id) { void do_parse() { unsigned short id; char *temp; - char direction; Being *being = NULL; FloorItem *floorItem = NULL; int len, n_items; |