Răsfoiți Sursa

RMG will now multiply Monolith defs to ensure there are at least 100 pairs avaiable for connections.

DjWarmonger 9 ani în urmă
părinte
comite
676f078b2e
2 a modificat fișierele cu 11 adăugiri și 0 ștergeri
  1. 1 0
      ChangeLog
  2. 10 0
      lib/mapObjects/CObjectClassesHandler.cpp

+ 1 - 0
ChangeLog

@@ -20,6 +20,7 @@ RANDOM MAP GENERATOR:
 * Zones will not have straight paths anymore, they are totally random
 * Added Thieves Guild random object (1 per zone)
 * Added Seer Huts with quests that match OH3
+* RMG will guarantee at least 100 pairs of Monoliths are available even if there are not enough different defs
 
 0.97 -> 0.98
 GENERAL:

+ 10 - 0
lib/mapObjects/CObjectClassesHandler.cpp

@@ -299,6 +299,16 @@ void CObjectClassesHandler::afterLoadFinalization()
 				logGlobal->warnStream() << "No templates found for " << entry.first << ":" << obj.first;
 		}
 	}
+
+	//duplicate existing two-way portals to make reserve for RMG
+	auto& portalVec = objects[Obj::MONOLITH_TWO_WAY]->objects;
+	size_t portalCount = portalVec.size();
+	size_t currentIndex = portalCount;
+	while (portalVec.size() < 100)
+	{
+		portalVec[currentIndex] = portalVec[currentIndex % portalCount];
+		currentIndex++;
+	}
 }
 
 std::string CObjectClassesHandler::getObjectName(si32 type) const