mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
- Move Hero / Prison distribution to separate modificator
- Protect rolling and banning hero with mutex
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#include "modificators/ObjectManager.h"
|
||||
#include "modificators/RoadPlacer.h"
|
||||
#include "modificators/TreasurePlacer.h"
|
||||
#include "modificators/PrisonHeroPlacer.h"
|
||||
#include "modificators/QuestArtifactPlacer.h"
|
||||
#include "modificators/ConnectionsPlacer.h"
|
||||
#include "modificators/TownPlacer.h"
|
||||
@ -122,6 +123,7 @@ void RmgMap::initTiles(CMapGenerator & generator, CRandomGenerator & rand)
|
||||
void RmgMap::addModificators()
|
||||
{
|
||||
bool hasObjectDistributor = false;
|
||||
bool hasHeroPlacer = false;
|
||||
bool hasRockFiller = false;
|
||||
|
||||
for(auto & z : getZones())
|
||||
@ -134,6 +136,11 @@ void RmgMap::addModificators()
|
||||
zone->addModificator<ObjectDistributor>();
|
||||
hasObjectDistributor = true;
|
||||
}
|
||||
if (!hasHeroPlacer)
|
||||
{
|
||||
zone->addModificator<PrisonHeroPlacer>();
|
||||
hasHeroPlacer = true;
|
||||
}
|
||||
zone->addModificator<TreasurePlacer>();
|
||||
zone->addModificator<ObstaclePlacer>();
|
||||
zone->addModificator<TerrainPainter>();
|
||||
|
Reference in New Issue
Block a user