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

Merge pull request #4554 from Laserlicht/8th_fix

fixes bug for 8th creature
This commit is contained in:
Ivan Savenko 2024-09-03 12:40:56 +03:00 committed by GitHub
commit f033ce8347
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]);