1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Distribute objects among zones in random order

This commit is contained in:
Tomasz Zieliński
2023-12-07 17:41:41 +01:00
parent 7fa01a3497
commit c316087950

View File

@@ -42,8 +42,6 @@ void ObjectDistributor::init()
void ObjectDistributor::distributeLimitedObjects()
{
//FIXME: Must be called after TerrainPainter::process()
ObjectInfo oi;
auto zones = map.getZones();
@@ -77,6 +75,8 @@ void ObjectDistributor::distributeLimitedObjects()
auto rmgInfo = handler->getRMGInfo();
// FIXME: Random order of distribution
RandomGeneratorUtil::randomShuffle(matchingZones, zone.getRand());
for (auto& zone : matchingZones)
{
oi.generateObject = [primaryID, secondaryID]() -> CGObjectInstance *