Ver código fonte

Merge pull request #284 from dydzio0614/Bug2640

Great :)
DjWarmonger 8 anos atrás
pai
commit
2401c81d4e
1 arquivos alterados com 10 adições e 0 exclusões
  1. 10 0
      AI/VCAI/VCAI.cpp

+ 10 - 0
AI/VCAI/VCAI.cpp

@@ -1404,6 +1404,16 @@ void VCAI::buildStructure(const CGTownInstance * t)
 		return;
 	if (tryBuildAnyStructure(t, std::vector<BuildingID>(extra, extra + ARRAY_COUNT(extra))))
 		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)