1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Zone guard will cause object be placed as far away from it as possible in both zones.

This commit is contained in:
DjWarmonger
2016-12-20 11:58:39 +01:00
parent 6848a52ce1
commit e37c35e439
3 changed files with 12 additions and 7 deletions

View File

@ -534,6 +534,7 @@ void CMapGenerator::createDirectConnections()
{
setOccupied(guardPos, ETileType::FREE); //just in case monster is too weak to spawn
zoneA->addMonster(this, guardPos, connection.getGuardStrength(), false, true);
zoneB->updateDistances(this, guardPos); //place next objects away from guard in both zones
//zones can make paths only in their own area
zoneA->crunchPath(this, guardPos, posA, true, zoneA->getFreePaths()); //make connection towards our zone center
zoneB->crunchPath(this, guardPos, posB, true, zoneB->getFreePaths()); //make connection towards other zone center