1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Merge pull request #1215 from IvanSavenko/tower_icon_fix

Do not show destroyed towers in battle results window
This commit is contained in:
Andrii Danylchenko
2022-12-07 17:35:34 +02:00
committed by GitHub

View File

@@ -478,7 +478,11 @@ CBattleResultWindow::CBattleResultWindow(const BattleResult & br, CPlayerInterfa
int yPos = 344 + step * 97;
for(auto & elem : br.casualties[step])
{
icons.push_back(std::make_shared<CAnimImage>("CPRSMALL", CGI->creatures()->getByIndex(elem.first)->getIconIndex(), 0, xPos, yPos));
auto creature = CGI->creatures()->getByIndex(elem.first);
if (creature->getId() == CreatureID::ARROW_TOWERS )
continue; // do not show destroyed towers in battle results
icons.push_back(std::make_shared<CAnimImage>("CPRSMALL", creature->getIconIndex(), 0, xPos, yPos));
std::ostringstream amount;
amount<<elem.second;
labels.push_back(std::make_shared<CLabel>(xPos + 16, yPos + 42, FONT_SMALL, CENTER, Colors::WHITE, amount.str()));