1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-10-08 23:22:25 +02:00
This commit is contained in:
Laserlicht
2025-10-04 17:43:37 +02:00
parent e1eba7c231
commit 7c74f34ddc

View File

@@ -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;