Merge pull request #284 from dydzio0614/Bug2640

Great :)
This commit is contained in:
DjWarmonger
2017-02-18 21:51:50 +01:00
committed by GitHub
+10
View File
@@ -1404,6 +1404,16 @@ void VCAI::buildStructure(const CGTownInstance * t)
return; return;
if (tryBuildAnyStructure(t, std::vector<BuildingID>(extra, extra + ARRAY_COUNT(extra)))) if (tryBuildAnyStructure(t, std::vector<BuildingID>(extra, extra + ARRAY_COUNT(extra))))
return; return;
//at the end, try to get and build any extra buildings with nonstandard slots (for example HotA 3rd level dwelling)
std::vector<BuildingID> extraBuildings;
for (auto buildingInfo : t->town->buildings)
if (buildingInfo.first > 43)
extraBuildings.push_back(buildingInfo.first);
if (tryBuildAnyStructure(t, extraBuildings))
return;
} }
bool VCAI::isGoodForVisit(const CGObjectInstance *obj, HeroPtr h, SectorMap &sm) bool VCAI::isGoodForVisit(const CGObjectInstance *obj, HeroPtr h, SectorMap &sm)