mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Code review
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user