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

Remove int <=> Identifier comparisons

This commit is contained in:
Ivan Savenko
2023-11-02 17:12:58 +02:00
parent 885dce0c27
commit 3634fb2158
12 changed files with 28 additions and 28 deletions

View File

@@ -144,7 +144,7 @@ void CMapGenOptions::resetPlayersMap()
for(const auto & p : players)
{
auto town = p.second.getStartingTown();
if (town != RANDOM_SIZE)
if (town != FactionID::RANDOM)
rememberTownTypes[p.first] = FactionID(town);
rememberTeam[p.first] = p.second.getTeam();
}
@@ -522,17 +522,17 @@ void CMapGenOptions::CPlayerSettings::setColor(const PlayerColor & value)
color = value;
}
si32 CMapGenOptions::CPlayerSettings::getStartingTown() const
FactionID CMapGenOptions::CPlayerSettings::getStartingTown() const
{
return startingTown;
}
void CMapGenOptions::CPlayerSettings::setStartingTown(si32 value)
void CMapGenOptions::CPlayerSettings::setStartingTown(FactionID value)
{
assert(value >= -1);
if(value >= 0)
assert(value >= FactionID::RANDOM);
if(value != FactionID::RANDOM)
{
assert(value < static_cast<int>(VLC->townh->size()));
assert(value < FactionID(VLC->townh->size()));
assert((*VLC->townh)[value]->town != nullptr);
}
startingTown = value;