1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Fix Orrin as starting hero on some maps

Fixes a bug that led to Orrin being replaced with a different randomly
selected hero on maps where starting hero is not generated in town, but
pre-placed on map
This commit is contained in:
Ivan Savenko
2024-11-24 20:05:34 +00:00
parent a4417f3fc5
commit 1116c18af5
2 changed files with 4 additions and 2 deletions

View File

@ -661,8 +661,10 @@ void CGHeroInstance::pickRandomObject(vstd::RNG & rand)
if (ID == Obj::RANDOM_HERO)
{
auto selectedHero = cb->gameState()->pickNextHeroType(getOwner());
ID = Obj::HERO;
subID = cb->gameState()->pickNextHeroType(getOwner());
subID = selectedHero;
randomizeArmy(getHeroClass()->faction);
}