1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

don't add Necromancy to Witch Hut on random maps

This commit is contained in:
Andrey Filipenkov
2022-10-01 16:01:47 +03:00
parent acfdbe87fe
commit b26db479d7

View File

@@ -1452,8 +1452,10 @@ void CGWitchHut::initObj(CRandomGenerator & rand)
{
if (allowedAbilities.empty()) //this can happen for RMG. regular maps load abilities from map file
{
// Necromancy can't be learned on random maps
for(int i = 0; i < VLC->skillh->size(); i++)
allowedAbilities.push_back(i);
if(VLC->skillh->getByIndex(i)->getId() != SecondarySkill::NECROMANCY)
allowedAbilities.push_back(i);
}
ability = *RandomGeneratorUtil::nextItem(allowedAbilities, rand);
}