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