mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Remove int <=> Identifier comparisons
This commit is contained in:
@@ -372,7 +372,7 @@ bool CGTownInstance::isBonusingBuildingAdded(BuildingID bid) const
|
||||
{
|
||||
auto present = std::find_if(bonusingBuildings.begin(), bonusingBuildings.end(), [&](CGTownBuilding* building)
|
||||
{
|
||||
return building->getBuildingType().num == bid;
|
||||
return building->getBuildingType() == bid;
|
||||
});
|
||||
|
||||
return present != bonusingBuildings.end();
|
||||
@@ -470,7 +470,7 @@ FactionID CGTownInstance::randomizeFaction(CRandomGenerator & rand)
|
||||
|
||||
std::vector<FactionID> potentialPicks;
|
||||
|
||||
for (FactionID faction(0); faction < VLC->townh->size(); ++faction)
|
||||
for (FactionID faction(0); faction < FactionID(VLC->townh->size()); ++faction)
|
||||
if (VLC->factions()->getById(faction)->hasTown())
|
||||
potentialPicks.push_back(faction);
|
||||
|
||||
@@ -996,9 +996,9 @@ bool CGTownInstance::hasBuilt(const BuildingID & buildingID) const
|
||||
return vstd::contains(builtBuildings, buildingID);
|
||||
}
|
||||
|
||||
bool CGTownInstance::hasBuilt(const BuildingID & buildingID, int townID) const
|
||||
bool CGTownInstance::hasBuilt(const BuildingID & buildingID, FactionID townID) const
|
||||
{
|
||||
if (townID == town->faction->getIndex() || townID == ETownType::ANY)
|
||||
if (townID == town->faction->getId() || townID == FactionID::ANY)
|
||||
return hasBuilt(buildingID);
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user