diff --git a/lib/mapObjects/CGTownInstance.cpp b/lib/mapObjects/CGTownInstance.cpp index 7903e5fcd..e19d80cee 100644 --- a/lib/mapObjects/CGTownInstance.cpp +++ b/lib/mapObjects/CGTownInstance.cpp @@ -478,7 +478,7 @@ void CGTownInstance::initObj(vstd::RNG & rand) ///initialize town structures BuildingID buildID = BuildingID(BuildingID::getDwellingFromLevel(level, 0)); int upgradeNum = 0; - for (; town->buildings.count(buildID); upgradeNum++, buildID.advance(town->creatures.size())) + for (; town->buildings.count(buildID); upgradeNum++, BuildingID::advanceDwelling(buildID)) { if (hasBuilt(buildID) && town->creatures.at(level).size() > upgradeNum) creatures[level].second.push_back(town->creatures[level][upgradeNum]);