From 504dc7dfd8078b274c2cda27b4130f42af767bf2 Mon Sep 17 00:00:00 2001 From: titiger Date: Thu, 29 Jan 2015 21:59:05 +0100 Subject: [PATCH] no more false clicks on minimap if minimap was displayed outside of map, it was not possible to give mouse click commands there. --- source/glest_game/gui/gui.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index 81ae45f37..cb15b3076 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -257,8 +257,8 @@ void Gui::mouseDownLeftGraphics(int x, int y, bool prepared) { if(selectingPos) { //give standard orders Vec2i targetPos=game->getMouseCellPos(); - if(game->isValidMouseCellPos() && - world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) { + if(prepared || (game->isValidMouseCellPos() && + world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) { giveTwoClickOrders(x, y, prepared); } resetState(); @@ -267,8 +267,8 @@ void Gui::mouseDownLeftGraphics(int x, int y, bool prepared) { else if(selectingMeetingPoint) { if(selection.isCommandable()) { Vec2i targetPos=game->getMouseCellPos(); - if(game->isValidMouseCellPos() && - world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) { + if(prepared || (game->isValidMouseCellPos() && + world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) { commander->trySetMeetingPoint(selection.getFrontUnit(), targetPos); } } @@ -288,15 +288,15 @@ void Gui::mouseDownRightGraphics(int x, int y , bool prepared) { else if(selection.isCommandable()) { if(prepared) { Vec2i targetPos=game->getMouseCellPos(); - if(game->isValidMouseCellPos() && - world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) { + if(prepared || (game->isValidMouseCellPos() && + world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true )) { givePreparedDefaultOrders(x, y); } } else { Vec2i targetPos=game->getMouseCellPos(); - if(game->isValidMouseCellPos() && - world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) { + if(prepared || (game->isValidMouseCellPos() && + world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) { giveDefaultOrders(x, y); } }