From 052cdbd8fce689b64371da82409bfd4e0f189f45 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Fri, 31 Oct 2008 23:01:23 +0000 Subject: Merged revisions 4071,4093,4100,4363 via svnmerge from https://themanaworld.svn.sourceforge.net/svnroot/themanaworld/tmw/branches/0.0 ........ r4071 | the_enemy | 2008-04-11 16:12:30 +0200 (Fri, 11 Apr 2008) | 3 lines Players now need to click on the monster sprites rather than the tile. Players will now move to the target before attacking it. ........ r4093 | the_enemy | 2008-04-15 18:10:32 +0200 (Tue, 15 Apr 2008) | 1 line Fixed clicking near player. ........ r4100 | peaveydk | 2008-04-16 13:59:36 +0200 (Wed, 16 Apr 2008) | 1 line Cancel walking to a clicked monster if the target is lost while getting to it (killed or otherwise removed). ........ r4363 | crush_tmw | 2008-06-24 14:42:04 +0200 (Tue, 24 Jun 2008) | 1 line corrected date in changelog ........ --- src/gui/viewport.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/viewport.cpp b/src/gui/viewport.cpp index d086418f..9671e34f 100644 --- a/src/gui/viewport.cpp +++ b/src/gui/viewport.cpp @@ -370,8 +370,10 @@ void Viewport::mousePressed(gcn::MouseEvent &event) mPlayerFollowMouse = false; - const int tilex = (event.getX() + (int) mViewX) / 32; - const int tiley = (event.getY() + (int) mViewY) / 32; + const int pixelx = event.getX() + (int) mViewX; + const int pixely = event.getY() + (int) mViewY; + const int tilex = pixelx / mMap->getTileWidth(); + const int tiley = pixely / mMap->getTileHeight(); // Right click might open a popup if (event.getButton() == gcn::MouseEvent::RIGHT) @@ -379,7 +381,7 @@ void Viewport::mousePressed(gcn::MouseEvent &event) Being *being; FloorItem *floorItem; - if ((being = beingManager->findBeing(tilex, tiley)) && + if ((being = beingManager->findBeingByPixel(tilex, tiley)) && being != player_node) { mPopupMenu->showPopup(event.getX(), event.getY(), being); -- cgit v1.2.3-70-g09d2