1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Merge pull request #1033 from kambala-decapitator/necro-witch-hut-rmg

don't add Necromancy to Witch Hut on random maps
This commit is contained in:
Andrii Danylchenko 2022-10-01 17:55:38 +03:00 committed by GitHub
commit 21c035e5d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -58,7 +58,6 @@ CObjectClassesHandler::CObjectClassesHandler()
SET_HANDLER("randomDwelling", CGDwelling);
SET_HANDLER("generic", CGObjectInstance);
SET_HANDLER("market", CGMarket);
SET_HANDLER("cartographer", CCartographer);
SET_HANDLER("artifact", CGArtifact);
SET_HANDLER("blackMarket", CGBlackMarket);

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);
}