summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-27 19:05:07 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2006-08-27 19:05:07 +0000
commit6f6d061b23c6c70c632fb3ec6aa3735325f701e0 (patch)
treea0d57853d826ebca0abe9ec86973c64bec688427 /src/gui
parenta544d1b3bf1d133d5877aa97d59d7128555e69fc (diff)
downloadmana-client-6f6d061b23c6c70c632fb3ec6aa3735325f701e0.tar.gz
mana-client-6f6d061b23c6c70c632fb3ec6aa3735325f701e0.tar.bz2
mana-client-6f6d061b23c6c70c632fb3ec6aa3735325f701e0.tar.xz
mana-client-6f6d061b23c6c70c632fb3ec6aa3735325f701e0.zip
Implemented pixel-grained movements.
Diffstat (limited to 'src/gui')
-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();
}
}