mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
Implemented deterministic secondary skills, #1166.
This commit is contained in:
@@ -205,7 +205,11 @@ void CGameHandler::levelUpHero(const CGHeroInstance * hero)
|
||||
else if(hlu.skills.size() == 1 || hero->tempOwner == PlayerColor::NEUTRAL) //choose skill automatically
|
||||
{
|
||||
sendAndApply(&hlu);
|
||||
levelUpHero(hero, vstd::pickRandomElementOf (hlu.skills, rand));
|
||||
auto rng = [&]()-> ui32
|
||||
{
|
||||
return hero->skillsInfo.randomSeed; //must be determined
|
||||
};
|
||||
levelUpHero(hero, vstd::pickRandomElementOf (hlu.skills, rng));
|
||||
}
|
||||
else if(hlu.skills.size() > 1)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user