From 94218cc8e93ed7087c4036312fb469d0070802e3 Mon Sep 17 00:00:00 2001 From: Stefan Dombrowski Date: Wed, 6 Oct 2010 16:06:49 +0200 Subject: Fixing movement with the mouse When a player clicked on a tile in order to go to it, then he went to the wrong tile. Trivial fix. --- src/gui/viewport.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/gui') diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index ce506ba1..0b7cc0f8 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -471,10 +471,8 @@ void Viewport::mouseDragged(gcn::MouseEvent &event) if (mLocalWalkTime != player_node->getWalkTime()) { mLocalWalkTime = player_node->getWalkTime(); - int destX = (event.getX() + mPixelViewX + 16) / - mMap->getTileWidth(); - int destY = (event.getY() + mPixelViewY + 16) / - mMap->getTileHeight(); + int destX = (event.getX() + mPixelViewX) / mMap->getTileWidth(); + int destY = (event.getY() + mPixelViewY) / mMap->getTileHeight(); player_node->setDestination(destX, destY); } } -- cgit v1.2.3-70-g09d2