1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-29 00:41:38 +02:00

- fixed out of sync hero armies

- one more crash in garrison
This commit is contained in:
Ivan Savenko
2012-12-12 14:52:42 +00:00
parent 72ea5e4ac9
commit ec8e078ef8
2 changed files with 8 additions and 2 deletions

View File

@ -494,7 +494,10 @@ int CGameState::pickHero(int owner)
for (si32 i=firstHero; i<lastHero; i++)
factionHeroes.push_back(i);
// we need random order to select hero
std::random_shuffle(factionHeroes.begin(), factionHeroes.end());
std::random_shuffle(factionHeroes.begin(), factionHeroes.end(), [](size_t range)
{
return ran() % range;
});
for (size_t i=0; i<factionHeroes.size(); i++)
{