|
@@ -210,6 +210,7 @@ void CGameState::init(const IMapService * mapService, StartInfo * si, Load::Prog
|
|
|
buildBonusSystemTree();
|
|
|
initVisitingAndGarrisonedHeroes();
|
|
|
initFogOfWar();
|
|
|
+ initTimedEventsRemovableObjects();
|
|
|
|
|
|
for(auto & elem : teams)
|
|
|
{
|
|
@@ -951,6 +952,28 @@ void CGameState::initMapObjects()
|
|
|
map->calculateGuardingGreaturePositions(); //calculate once again when all the guards are placed and initialized
|
|
|
}
|
|
|
|
|
|
+void CGameState::initTimedEventsRemovableObjects()
|
|
|
+{
|
|
|
+ for(auto & timedEvent : map->events)
|
|
|
+ {
|
|
|
+ for(int3 coordinate : timedEvent.deletedObjectsCoordinates)
|
|
|
+ {
|
|
|
+ if(isInTheMap(coordinate))
|
|
|
+ {
|
|
|
+ for(const CGObjectInstance * object : getBlockingObjs(coordinate))
|
|
|
+ {
|
|
|
+ timedEvent.deletedObjectsInstances.insert(object);
|
|
|
+ }
|
|
|
+
|
|
|
+ for(const CGObjectInstance * object : getVisitableObjs(coordinate))
|
|
|
+ {
|
|
|
+ timedEvent.deletedObjectsInstances.insert(object);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
void CGameState::placeHeroesInTowns()
|
|
|
{
|
|
|
for(auto & player : players)
|