mirror of
https://github.com/vcmi/vcmi.git
synced 2025-08-13 19:54:17 +02:00
Randomly shuffle required objects to avoid patterns
This commit is contained in:
committed by
Andrii Danylchenko
parent
8f0dcf928c
commit
670bca2fdb
@@ -27,7 +27,7 @@
|
|||||||
void ObjectManager::process()
|
void ObjectManager::process()
|
||||||
{
|
{
|
||||||
zone.fractalize();
|
zone.fractalize();
|
||||||
createRequiredObjects();
|
createRequiredObjects();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectManager::init()
|
void ObjectManager::init()
|
||||||
@@ -220,6 +220,7 @@ bool ObjectManager::createRequiredObjects()
|
|||||||
{
|
{
|
||||||
logGlobal->trace("Creating required objects");
|
logGlobal->trace("Creating required objects");
|
||||||
|
|
||||||
|
RandomGeneratorUtil::randomShuffle(requiredObjects, generator.rand);
|
||||||
for(const auto & object : requiredObjects)
|
for(const auto & object : requiredObjects)
|
||||||
{
|
{
|
||||||
auto * obj = object.first;
|
auto * obj = object.first;
|
||||||
|
Reference in New Issue
Block a user