Laserlicht 2 months ago
parent
commit
7c74f34ddc
1 changed files with 5 additions and 4 deletions
  1. 5 4
      client/windows/CKingdomInterface.cpp

+ 5 - 4
client/windows/CKingdomInterface.cpp

@@ -648,15 +648,16 @@ void CKingdomInterface::generateMinesList(const std::vector<const CGObjectInstan
 
 	for(int i=0; i<GameConstants::RESOURCE_QUANTITY; i++)
 	{
-		std::string value = std::to_string(minesCount[i]);
+		int resID = line * GameConstants::RESOURCE_QUANTITY + i;
+		if(resID >= LIBRARY->resourceTypeHandler->getAllObjects().size())
+			break;
+
+		std::string value = std::to_string(minesCount[resID]);
 		std::shared_ptr<InfoBoxCustom> data;
 		if(line == 0)
 			data = std::make_shared<InfoBoxCustom>(value, "", AnimationPath::builtin("OVMINES"), i, LIBRARY->generaltexth->translate("core.minename", i));
 		else
 		{
-			int resID = line * GameConstants::RESOURCE_QUANTITY + i;
-			if(resID >= LIBRARY->resourceTypeHandler->getAllObjects().size())
-				break;
 			auto mine = getMineHandler(GameResID(resID));
 			if(!mine || mine->getKingdomOverviewImage().empty())
 				continue;