Forráskód Böngészése

don't add Necromancy to Witch Hut on random maps

Andrey Filipenkov 3 éve
szülő
commit
b26db479d7
1 módosított fájl, 3 hozzáadás és 1 törlés
  1. 3 1
      lib/mapObjects/MiscObjects.cpp

+ 3 - 1
lib/mapObjects/MiscObjects.cpp

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