summaryrefslogtreecommitdiff
path: root/src/gui/gui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/gui.cpp')
-rw-r--r--src/gui/gui.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/gui.cpp b/src/gui/gui.cpp
index a3ec299b..5df26d63 100644
--- a/src/gui/gui.cpp
+++ b/src/gui/gui.cpp
@@ -245,8 +245,8 @@ Gui::mousePress(int mx, int my, int button)
if (current_npc)
return;
- int tilex = mx / 32 + camera_x;
- int tiley = my / 32 + camera_y;
+ int tilex = (mx + camera_x) / 32;
+ int tiley = (my + camera_y) / 32;
// Right click might open a popup
if (button == gcn::MouseInput::RIGHT)
@@ -313,7 +313,7 @@ Gui::mousePress(int mx, int my, int button)
Uint8 *keys = SDL_GetKeyState(NULL);
if (!(keys[SDLK_LSHIFT] || keys[SDLK_RSHIFT]))
{
- player_node->setDestination(tilex * 32 + 16, tiley * 32 + 16);
+ player_node->setDestination(mx + camera_x, my + camera_y);
player_node->stopAttack();
}
}