Browse Source

Do not show hero dot on minimap if icons are on to avoid artifacts on
small maps

Ivan Savenko 4 months ago
parent
commit
1cbfc067db
1 changed files with 8 additions and 2 deletions
  1. 8 2
      client/adventureMap/CMinimap.cpp

+ 8 - 2
client/adventureMap/CMinimap.cpp

@@ -49,6 +49,12 @@ ColorRGBA CMinimapInstance::getTileColor(const int3 & pos) const
 		if(player == PlayerColor::NEUTRAL)
 			return graphics->neutralColor;
 
+		if (settings["adventure"]["minimapShowHeroes"].Bool())
+		{
+			if (obj->ID == MapObjectID::HERO)
+				continue;
+		}
+
 		if (player.isValidPlayer())
 			return graphics->playerColors[player.getNum()];
 	}
@@ -134,8 +140,8 @@ Point CMinimap::tileToPixels(const int3 &tile) const
 	double stepX = static_cast<double>(pos.w) / mapSizes.x;
 	double stepY = static_cast<double>(pos.h) / mapSizes.y;
 
-	int x = static_cast<int>(stepX * tile.x);
-	int y = static_cast<int>(stepY * tile.y);
+	int x = static_cast<int>(stepX * (tile.x + 0.5));
+	int y = static_cast<int>(stepY * (tile.y + 0.5));
 
 	return Point(x,y);
 }