1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

fixes bug for 8th creature

This commit is contained in:
Laserlicht 2024-09-03 11:03:37 +02:00 committed by GitHub
parent ee64928454
commit ff65a33d44
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -478,7 +478,7 @@ void CGTownInstance::initObj(vstd::RNG & rand) ///initialize town structures
BuildingID buildID = BuildingID(BuildingID::getDwellingFromLevel(level, 0)); BuildingID buildID = BuildingID(BuildingID::getDwellingFromLevel(level, 0));
int upgradeNum = 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) if (hasBuilt(buildID) && town->creatures.at(level).size() > upgradeNum)
creatures[level].second.push_back(town->creatures[level][upgradeNum]); creatures[level].second.push_back(town->creatures[level][upgradeNum]);