mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Change gamestate initialization order - list of owned objects must be
initialized before connecting towns with visiting heroes, but after generateion of starting heroes
This commit is contained in:
parent
32ad9c1902
commit
d0b3bb95b2
@ -194,6 +194,7 @@ void CGameState::init(const IMapService * mapService, StartInfo * si, Load::Prog
|
|||||||
initRandomFactionsForPlayers();
|
initRandomFactionsForPlayers();
|
||||||
randomizeMapObjects();
|
randomizeMapObjects();
|
||||||
placeStartingHeroes();
|
placeStartingHeroes();
|
||||||
|
initOwnedObjects();
|
||||||
initDifficulty();
|
initDifficulty();
|
||||||
initHeroes();
|
initHeroes();
|
||||||
initStartingBonus();
|
initStartingBonus();
|
||||||
@ -492,8 +493,14 @@ void CGameState::randomizeMapObjects()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (object->getOwner().isValidPlayer())
|
void CGameState::initOwnedObjects()
|
||||||
|
{
|
||||||
|
for(CGObjectInstance *object : map->objects)
|
||||||
|
{
|
||||||
|
if (object && object->getOwner().isValidPlayer())
|
||||||
getPlayerState(object->getOwner())->addOwnedObject(object);
|
getPlayerState(object->getOwner())->addOwnedObject(object);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,6 +181,7 @@ private:
|
|||||||
void initGlobalBonuses();
|
void initGlobalBonuses();
|
||||||
void initGrailPosition();
|
void initGrailPosition();
|
||||||
void initRandomFactionsForPlayers();
|
void initRandomFactionsForPlayers();
|
||||||
|
void initOwnedObjects();
|
||||||
void randomizeMapObjects();
|
void randomizeMapObjects();
|
||||||
void initPlayerStates();
|
void initPlayerStates();
|
||||||
void placeStartingHeroes();
|
void placeStartingHeroes();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user