فهرست منبع

Check if a right click is in the map, so clicking on the border no longer opens an empty info windows.

Frank Zago 16 سال پیش
والد
کامیت
336fee48aa
1فایلهای تغییر یافته به همراه7 افزوده شده و 14 حذف شده
  1. 7 14
      client/CAdvmapInterface.cpp

+ 7 - 14
client/CAdvmapInterface.cpp

@@ -558,25 +558,18 @@ void CTerrainRect::clickLeft(tribool down, bool previousState)
 void CTerrainRect::clickRight(tribool down, bool previousState)
 {
 	int3 mp = whichTileIsIt();
-	if ((mp.x<0) 
-		|| (mp.y<0) 
-		|| down != true
-	  )
-	{
-		LOCPLINT->adventureInt->handleRightClick("",down,this);
+
+	if (!CGI->mh->map->isInTheMap(mp) || down != true)
 		return;
-	}
 
 	std::vector < const CGObjectInstance * > objs = LOCPLINT->cb->getBlockingObjs(mp);
 	if(!objs.size()) {
 		// Bare or undiscovered terrain
-		if (down) {
-			const TerrainTile * tile = LOCPLINT->cb->getTileInfo(mp);
-			if (tile) {
-				CSimpleWindow * temp = CMessage::genWindow(VLC->generaltexth->terrainNames[tile->tertype],LOCPLINT->playerID,true);
-				CRClickPopupInt *rcpi = new CRClickPopupInt(temp,true);
-				GH.pushInt(rcpi);
-			}
+		const TerrainTile * tile = LOCPLINT->cb->getTileInfo(mp);
+		if (tile) {
+			CSimpleWindow * temp = CMessage::genWindow(VLC->generaltexth->terrainNames[tile->tertype],LOCPLINT->playerID,true);
+			CRClickPopupInt *rcpi = new CRClickPopupInt(temp,true);
+			GH.pushInt(rcpi);
 		}
 		return;
 	}