1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fixes for various minor issues detected by Sonar Cloud

This commit is contained in:
Ivan Savenko
2024-06-01 11:48:30 +00:00
parent df83fa33a1
commit b8beb4fb13
29 changed files with 58 additions and 61 deletions

View File

@@ -478,7 +478,7 @@ void TownSelector::updateListItems()
{
if(y >= line && (y - line) < 3)
{
auto getImageIndex = [](FactionID factionID, bool enabled){ return factionID.toFaction()->town->clientInfo.icons[true][!enabled] + 2; };
auto getImageIndex = [](FactionID targetFactionID, bool enabled){ return targetFactionID.toFaction()->town->clientInfo.icons[true][!enabled] + 2; };
towns[factionID] = std::make_shared<CAnimImage>(AnimationPath::builtin("ITPA"), getImageIndex(factionID, townsEnabled[factionID]), 0, x_offset + 48 * x, 32 * (y - line));
townsArea[factionID] = std::make_shared<LRClickableArea>(Rect(x_offset + 48 * x, 32 * (y - line), 48, 32), [this, getImageIndex, factionID](){
townsEnabled[factionID] = !townsEnabled[factionID];