1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Fix randomization of heroes in campaigns

This commit is contained in:
Ivan Savenko 2023-11-12 19:18:17 +02:00
parent 1d430d0328
commit bbd3312705

View File

@ -217,6 +217,10 @@ void CGameStateCampaign::placeCampaignHeroes()
for(auto & heroID : heroesToRemove) for(auto & heroID : heroesToRemove)
{ {
// Do not replace reserved heroes initially, e.g. in 1st campaign scenario in which they appear
if (campaignState->getHeroByType(heroID).isNull())
continue;
auto * hero = gameState->getUsedHero(heroID); auto * hero = gameState->getUsedHero(heroID);
if(hero) if(hero)
{ {