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