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:
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user