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

Code review

This commit is contained in:
Laserlicht
2024-05-02 20:15:34 +02:00
parent b9c4a56360
commit 37d9e862c2
3 changed files with 11 additions and 15 deletions

View File

@@ -444,12 +444,11 @@ TownSelector::TownSelector(const Point & loc)
setRedrawParent(true);
int count = 0;
CGI->factions()->forEach([this, &count](const Faction *entity, bool &stop){
if(!entity->hasTown())
return;
townsEnabled[entity->getFaction()] = true;
for(auto const & factionID : VLC->townh->getDefaultAllowed())
{
townsEnabled[factionID] = true;
count++;
});
};
auto divisionRoundUp = [](int x, int y){ return (x + (y - 1)) / y; };
@@ -472,7 +471,8 @@ void TownSelector::updateListItems()
towns.clear();
townsArea.clear();
int x = 0, y = 0;
int x = 0;
int y = 0;
CGI->factions()->forEach([this, &x, &y, line, x_offset](const Faction *entity, bool &stop){
if(!entity->hasTown())
return;